我正在尝试将ng2-tag-input安装到我的ionic应用程序中。
在使用npm install成功安装之后,下面是我的app.component.ts
import {TagInputModule} from 'ng2-tag-input';
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
@NgModule({
declarations : [
MyApp,
],
imports : [
CommonModule,
BrowserModule,
HttpModule,
PagesModule,
TagInputModule,
BrowserAnimationsModule,
IonicModule.forRoot(MyApp, {}, {
// DeepLinker
// http://blog.ionic.io/deeplinking-in-ionic-apps/
links: [
{component: ProfilePage, name: 'Profile', segment: 'profile/:username'},
{component: PhotoCardComponent, name: 'Photo', segment: 'photo/:id'},
{component: ChatMessagePage, name: 'Chat', segment: 'chat/:id'},
{component: TermsPage, name: 'Terms', segment: 'terms'},
]
})
],
exports : [
BrowserModule,
HttpModule,
TagInputModule
],然后当我跑的时候
ionic serve出现以下问题
Error: Uncaught (in promise): Error: Template parse errors:
'tag-input' is not a known element:
1. If 'tag-input' is an Angular component, then verify that it is part of this module.
2. If 'tag-input' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("
</ion-select>
</ion-item>
[ERROR ->]<tag-input [(ngModel)]="items"></tag-input>我不确定我做错了什么。有人能帮我指出吗?
https://stackoverflow.com/questions/44451248
复制相似问题