【问题标题】:Cannot find module angular2_material/material找不到模块 angular2_material/material
【发布时间】:2016-01-15 20:55:07
【问题描述】:

我正在尝试将 angular2 与 angular2_material 一起使用,但出现此错误。

找不到模块 angular2_material/material

我查看了此链接:https://github.com/urish/angular2-material-build,但无法理解为有效。我试图在 node_modules 中包含文件夹 angular2_material。

我也试过看这个http://plnkr.co/edit/vSS7yMroAeTDHALG8eEg?p=preview。不明白在客户端应用程序 js 中工作:

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)

这段代码是不是打字稿?

【问题讨论】:

标签: angular typescript angular-material


【解决方案1】:

angular2_material 还不能使用。另见https://github.com/angular/material2/issues/105

一旦准备好更多的东西,我们很快就会将 alpha.0 发布到 npm。该公告可能会在 Twitter 上发布,敬请期待!

【讨论】:

    猜你喜欢
    • 2017-04-29
    • 2020-06-10
    • 1970-01-01
    • 2018-05-28
    • 2018-07-11
    • 2019-09-30
    • 2019-05-16
    • 2020-09-09
    • 2020-10-30
    相关资源
    最近更新 更多