2016-04-13 10 views
0

ben eserler NG2-önyükleme hala bootstrap4-webpack-package Bootstrap 4 eser yapar Şu anda Angular2-meteor1.3 projesinde ng2-bootstrap nasıl kullanılır? Yeni bir proje için

npm init

meteor add angular2-compilers

meteor remove blaze-html-templates

meteor npm install --save angular2-meteor

meteor npm install --save meteor-node-stubs

meteor npm install --save bootstrap4-webpack-package

meteor npm install --save ng2-bootstrap

import 'reflect-metadata'; 
import 'zone.js/dist/zone'; 
import 'bootstrap4-webpack-package'; 
import { Component } from 'angular2/core'; 
import { bootstrap } from 'angular2/platform/browser'; 
import { Alert } from 'ng2-bootstrap/ng2-bootstrap'; 

@Component({ 
    selector: 'app', 
    template: `<alert type="info">ng2-bootstrap hello world!</alert>`, 
    directives: [Alert] 
}) 
class App { } 
bootstrap(App); 

terminali olanlar koşmak, ama.

Ben Bootstrap 4 kullandığım için, bu yüzden de

import { Ng2BootstrapConfig, Ng2BootstrapTheme } from 'ng2-bootstrap/ng2-bootstrap'; 
Ng2BootstrapConfig.theme = Ng2BootstrapTheme.BS4; 

Ama hala eserler eklemeye çalıştı.

EXCEPTION: No Directive annotation found on Alert

EXCEPTION: Error: Uncaught (in promise): No Directive annotation found on Alert

Ben bunun bu issue ile ilgili olup olmadığını emin değilim:

Bu hata gösterir.

ng2-bootstrap'i nasıl kullanabilirim? Thanks

+0

herhangi bir hata iletisi? –

+0

@ BhushanGadekar özür dilerim, eklemeyi unuttum. Yeni ekledim. –

cevap

0

Nihayet, NPM sorunum nedeniyle bulundu. Çünkü kod diğer insanların makinesinde iyi çalışır.

NPM'mi kaldırıyorum ve yeni v5.10.1'i yükleyin, sorun düzeltmeleri!

Ayrıntılar için here'u kontrol edin. Umarım, benzer garip problemlerle karşılaşan kişilere yardımcı olabilirsiniz.

İlgili konular