为什么组件不起作用?
Why component not work?
我正在使用 ionic 2.0 和 AngularJS 2.0,但组件 "drop-menu" 不工作。
所有代码都在https://github.com/aaronchen2k/test/tree/master/app
tabs.html
<drop-menu></drop-menu>
dropmenu.js
import {Component} from 'angular2/core';
@Component({
selector: 'drop-menu',
templateUrl: 'build/components/dropmenu/dropmenu.html'
})
export class DropMenuComponent {
constructor() {
}
}
如果您检查您的代码,您的组件正在运行,名称和图像在这里。
这只是 css 和 Ionic 标签使用的问题。
您想在哪里显示您的组件?在标签行与其他 4 个?在 header 中?否则?
缺少指令部分
@Page({
templateUrl: 'build/pages/tabs/tabs.html',
directives: [DropmenuComponent],
providers: [CategoryService]
})
我正在使用 ionic 2.0 和 AngularJS 2.0,但组件 "drop-menu" 不工作。 所有代码都在https://github.com/aaronchen2k/test/tree/master/app
tabs.html
<drop-menu></drop-menu>
dropmenu.js
import {Component} from 'angular2/core';
@Component({
selector: 'drop-menu',
templateUrl: 'build/components/dropmenu/dropmenu.html'
})
export class DropMenuComponent {
constructor() {
}
}
如果您检查您的代码,您的组件正在运行,名称和图像在这里。 这只是 css 和 Ionic 标签使用的问题。
您想在哪里显示您的组件?在标签行与其他 4 个?在 header 中?否则?
缺少指令部分
@Page({
templateUrl: 'build/pages/tabs/tabs.html',
directives: [DropmenuComponent],
providers: [CategoryService]
})