// in engagement.component.ts:
class EngagementMembersController {
alphabetic: Array<string> = 'abcdefghijklmnopqrstuvwxyz'.split('');
constructor() {}
export const EngagementSetupMember: IComponentOptions = {
controller: EngagementMembersController,
templateUrl: 'engagementMembers.component.html'
}
// in topbar.moudel.ts:
import {EngagementSetupMember} from './../engagement.component';
export const topBarMembersModule: string = angular
.module('topbar-members', [])
.controller(EngagementSetupMember.controller)
.component('topbarMemberComponant', {
require: {
controller: '^EngagementMembersController'
},
templateUrl: 'topBarMembers.component.html'
})
.name;
but when i use it, screen printed an error:
vendor.js:36574 Error: [$compile:ctreq] Controller 'EngagementMembersController', required by directive 'topbarMemberComponant', can't be found!
please help!
I thought I must to call EngagementMembersController by another component before I could use:
require: {
controller: '^EngagementMembersController'
},
in that case, i called in ui_router and it could be load