我有一个组件:
export const TopBarMemberComponent: angular.IComponentOptions = {
bindings: {},
require: {
controller: '^EngagementSetupMember'
},
templateUrl: 'topBarMembers.component.html'
}
和父组件:
export const EngagementSetupMember: IComponentOptions = {
controller: EngagementMembersController,
templateUrl: 'engagement.component.html'
}
这是模块
import {EngagementSetupMember} from './../engagementMembers.component';
import {TopBarMemberComponent} from './topBarMembers.component'
export const topBarMembersModule: string = angular
.module('topbar-members', [])
.component('topbarMemberComponant', TopBarMemberComponent)
.name;
但是当我使用它时,丝网印刷
找不到EngagementSetupMemberController
请帮助!
答案 0 :(得分:0)
到目前为止,您的代码应如下所示:
// topBarMember.component.ts
export const TopBarMemberComponent: angular.IComponentOptions = {
bindings: {},
require: {
controller: '^EngagementSetupMember'
},
templateUrl: requrire('./topBarMembers.component.html')
}
// engagementSetupMember.component.ts
export class EngagementMembersController {}
export const EngagementSetupMember: IComponentOptions = {
controller: EngagementMembersController,
templateUrl: require('./engagement.component.html')
}
// module.ts
import {EngagementSetupMember} from './../engagementMembers.component';
import {TopBarMemberComponent} from './topBarMembers.component'
export const topBarMembersModule: string = angular
.module('topbar-members', [])
.component('engagementSetupMember', EngagementSetupMember)
.component('topbarMemberComponant', TopBarMemberComponent)
.name;