angular.js - AngularJs Component() 没有执行
天蓬老师
天蓬老师 2017-05-15 17:11:23
0
1
459

项目基于 AngularJs 1.5.8 版本开发。
在使用 component() 时遇到问题:组件没有执行。

我的代码如下:

define(['angular','app'],function (angular,app) {
    var departmentSelector = {
        bindings: {
            option: '='
        },
        templateUrl: 'dist/component/department-selector/index.html',
        controller: DepartmentSelectorController,
        controllerAs: 'vm'
    };

    app.component('departmentSelector', departmentSelector);

    DepartmentSelectorController.$inject  = ['$filter'];
    function DepartmentSelectorController($filter) {
        console.log("执行 组件 departmentSelector 成功");
    }
});
天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

reply all(1)
阿神

I also encountered the same problem, I don’t know if you solved it. Initially, the first request was executed, but after refreshing, the component failed and the view was not displayed

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template