Using Angular Material with Angular Formly

484 Views Asked by At

I'm building an Angular2/4 app with Angular Formly (https://github.com/formly-js/ng-formly) and don't know how to give it an Angular Material (https://github.com/angular/material2) look.

With the AngularJS + angular-formly (http://angular-formly.com) + AngularJS Material trio it used to work as seen in the formly docs (http://angular-formly.com/#!/example/integrations/angular-material):

var app = angular.module('formlyExample', ['formly', 'ngAria', 'ngAnimate', 'ngMaterial']);

But how does this look like using Angular2 and the corresponding version of formly?

(I have material2 installed and all its necessary component modules imported.)

1

There are 1 best solutions below

0
On BEST ANSWER

You need to install formly-material template separately.

npm install @ngx-formly/material --save

Just follow all the steps specified here, notice step 2 and it will work.