Cannot find module angular2_material/material

2019-04-16 20:42发布

I am trying to use angular2 with angular2_material and I get this error.

Cannot find module angular2_material/material

I looked at this link: https://github.com/urish/angular2-material-build, but no understand as working. I tried to include the folder angular2_material in node_modules.

I tried looking at this http://plnkr.co/edit/vSS7yMroAeTDHALG8eEg?p=preview too. Not understand as worked in client aplication js this:

import {ComponentAnnotation as Component, ViewAnnotation as View, bootstrap} from 'angular2/angular2';
import {MdInput, MdInputContainer} from 'angular2_material/material';

@Component({
  selector: 'test-app'
})

@View({
  template:`
    <h1>AngularJs 2 Material Design Demo</h1>
    <md-input-container>
      <label>Your name</label>
      <input #newname />
    </md-input-container>
    <p>
      Hello, {{newname.value}}
    </p>
  `,
  directives: [MdInputContainer, MdInput]
})

class TestApp {
  constructor(){
    this.title = 'AngularJs 2 Material Design Demo';
  }
}

bootstrap(TestApp)

This code is typescript or not?

1条回答
ゆ 、 Hurt°
2楼-- · 2019-04-16 21:43

angular2_material is not yet useable. See also https://github.com/angular/material2/issues/105

We'll soon be publishing an alpha.0 to npm once a few more things are ready. The announcement will probably be on Twitter, so stay tuned!

查看更多
登录 后发表回答