Angular2 - Material2示例:MdAutoComplete

时间:2017-01-10 13:27:02

标签: javascript angular material-design angular-material

这是问题,

我实际上是在尝试那里的例子:

https://github.com/angular/material2

我被困在这一个:

https://github.com/angular/material2/tree/master/src/demo-app/autocomplete

我在CLI中使用angular2,所以我有一个新模板,我尝试“复制/粘贴”这个组件。但它失败了这条消息:

Unhandled Promise rejection: Template parse errors: 
Can't bind to 'mdAutocomplete' since it isn't a known propery of 'input'. ("
<div class="demo-autocomplete">
    <md-input-container>
        <input mdInput placeholder="state" [ERROR ->][mdAutocomplete]="auto">
...
...
There is no directive with "exportAs" set to "mdAutocomplete"
...

看起来mdAutocomplete指令不存在。 我一步一步地按照例子,有什么不对吗?

感谢您阅读/帮助

1 个答案:

答案 0 :(得分:2)

MdAutoComplete尚未完成! https://github.com/angular/material2/tree/master/src/lib/autocomplete

material2的更改日志说: https://github.com/angular/material2/blob/master/CHANGELOG.md

2.0.0-beta.1 rebar-teacup(2016-12-23)

  • 删除意外包含在beta.0中的MdAutocompleteModule
  • 更正package.json中的umd包的路径(#2368)(d286e6d),关闭#2366