相关疑难解决方法(0)

将Material Design Lite与Angular2集成

我有一个集成设计材质(一个小问题http://www.getmdl.io/在NG2)你能帮帮我,我就会把它在点我做了什么

  1. http://www.getmdl.io/started/index.html#tab1,解释了设计的集成
  2. http://www.getmdl.io/components/index.html#textfields-section,这是一个带有浮动标签的文本字段示例,现在我已经整合了Plunkr,但是没有工作可以请你看看正如您在index.html中看到的那样,我有http://www.getmdl.io/started/index.html#tab1建议的css和js文件包含

<!-- GetMDL scripts --> <link rel="stylesheet" href="https://storage.googleapis.com/code.getmdl.io/1.0.6/material.indigo-pink.min.css"> <script src="https://storage.googleapis.com/code.getmdl.io/1.0.6/material.min.js"></script> <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons"> <!-- GetMDL scripts --> 在app.component.ts文件中:

import {Component, ViewEncapsulation} from 'angular2/core';

@Component({
    selector: 'my-app',
    template: `<form action="#">
  <div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
    <input class="mdl-textfield__input" type="text" id="sample3">
    <label class="mdl-textfield__label" for="sample3">Text...</label>
  </div>
</form>`,
encapsulation:ViewEncapsulation.None,
})
Run Code Online (Sandbox Code Playgroud)

integration typescript angular

35
推荐指数
3
解决办法
2万
查看次数

标签 统计

angular ×1

integration ×1

typescript ×1