project is developed based on the AngularJs 1.5.8
version.
Encountered a problem when using component()
: component not executing.
My code is as follows:
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