Я новичок в Угловое 2 и есть проблема я использую Angular2 + WebPack, я импортировать угловые компоненты материала, но он не работаетИмпорт Материал дизайн Угловое 2 + WebPack
//////////////////
// WEBPACK
///////////
new DllBundlesPlugin({
bundles: {
'@angular/material',
}
})
// APP MODULE
import { MaterialModule } from '@angular/material';
// Should I use @angular/material or @angular2-material
import { MaterialModule } from '@angular2-material';
import 'hammerjs';
@NgModule({
imports: [MetarialModule.forRoot()]
})
// COMPONENT
// import { MdButton } from '@angular/material';
import { MdButton } from '@angular2-material/button';
@Component({
selector: 'test',
templateUrl: './test.html',
directive: [MdButton] // It says
//Generic type 'Type<T>' requires 1 type argument(s)
// Argument of type '{ selector: string; template: any; directives: typeof MdButton[]; }' is not assignable to parameter of type 'Component'.
//Object literal may only specify known properties, and 'directives' does not exist in type 'Component'.
})
Я использую неправильную версию или не включил что-то?
Здравствуйте! Спасибо за ваш совет. Я попытался понять, как это работает. Угловая - Cli отлично работает, но не может понять, где конфигурации Webpack – DarthJS
Большое спасибо, я понял, что Webpack не включен, мне нужно сделать некоторые манипуляции. – DarthJS
angular-cli делает некоторую работу над op webpack и вы не имеют доступа к конфигурации webpack. Существует проблема, о которой вы можете ознакомиться здесь: https://github.com/angular/angular-cli/issues/1656#issuecomment-240171375 и https://github.com/angular/angular-cli/issues/ 1656 # issuecomment-239366723 ... Если вам нужно получить доступ к конфигурации webpack, вы должны определенно не использовать angular-cli, тогда ... – Maxime