项目基于 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 成功");
}
});
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