DarthJS
@DarthJS

Как подключить Material Design + Angular 2 + Webpack?

Кто сталкивался с таким?
Я только начинаю работу с Angular 2 и немного путаюсь в версиях.
Так как раньше работал с Webpack, по привычке использую его.
Получается такой результат:
//////////////////
// WEBPACK
///////////
new DllBundlesPlugin({
   bundles: {
     '@angular/material',
     }
  })

// APP MODULE
import { MaterialModule } from '@angular/material';
// Какую версию нужно устанавливать @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] // Выдаёт такую ошибку
  //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'. 
})
  • Вопрос задан
  • 1390 просмотров
Пригласить эксперта
Ответы на вопрос 1
@kgorozhanov
Front-End Developer
Советую использовать Angular CLI
directive: [MdButton] // Не актуально
https://material.angular.io/components/component/button
Ответ написан
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы