开发手册 欢迎您!
软件开发者资料库

Angular Material - 环境设置

Angular Material环境设置 - 从简单和简单的步骤学习角度材料从基本到高级概念,包括概述,环境设置,自动完成,底部工作表,按钮,卡片,复选框,芯片,联系芯片,内容,DatePicker,对话框,分频器,Fab速拨,Fab工具栏,网格,图标,输入,布局,列表,菜单,菜单栏,进度条,单选按钮,选择,SideNav,滑块,Subheaders,刷卡,开关,选项卡,主题,敬酒,工具栏,工具提示,排版,虚拟重复,WhiteFrame。

如何使用Angular材料?

有两种方法可以使用Angular Material :

  • 本地安装 : 您可以在本地计算机上使用npm,jspm或bower下载Angular Material库,并将其包含在HTML代码中.

  • 基于CDN的版本 : 您可以直接从Content Delivery Network(CDN)将angular-material.min.css和angular-material js文件包含到HTML代码中.

本地安装

因为我们使用以下npm命令,我们需要在我们的系统上安装NodeJS.要获取有关节点JS的信息,然后打开NodeJS命令行界面.我们将使用以下命令安装Angular Material库.

  npm install angular-material

以上命令将生成以下输出 :

 angular-animate@1.5.2 node_modules\angular-animate  angular-aria@1.5.2 node_modules\angular-aria  angular-messages@1.5.2 node_modules\angular-messages  angular@1.5.2 node_modules \angular  angular-material@1.0.6 node_modules\angular-material

npm 将下载 node_modules>下的文件. angular-material 文件夹.包括以下示例中所述的文件 :

示例

现在您可以包含 css 和 js 

                                                                angular.module('firstApplication', ['ngMaterial']);                                          HTML 5         
                           

HTML5 is the next major revision of the HTML standard superseding HTML         4.01, XHTML 1.0, and XHTML 1.1. HTML5 is a standard for structuring and         presenting content on the World Wide Web.

                  

HTML5 is a cooperation between the World Wide Web Consortium (W3C) and         the Web Hypertext Application Technology Working Group (WHATWG).

                  

The new standard incorporates features like video playback and drag-and-drop         that have been previously dependent on third-party browser plug-ins such as         Adobe Flash, Microsoft Silverlight, and Google Gears.

         

基于CDN的版本

您可以直接从Content Delivery Network(CDN)将angular-material.css和angular-material.js文件包含到HTML代码中。 Google CDN提供最新版本的内容。

我们在本教程中使用了该库的Google CDN版本。

示例

现在让我们使用来自Google CDN的angular-material.min.css和angular-material.min.js重写上面的例子。

                                                          angular.module('firstApplication', ['ngMaterial']);                                          HTML 5         
                           

HTML5 is the next major revision of the HTML standard superseding HTML 4.01,         XHTML 1.0, and XHTML 1.1. HTML5 is a standard for structuring and presenting          content on the World Wide Web.

         

HTML5 is a cooperation between the World Wide Web Consortium (W3C) and the Web         ypertext Application Technology Working Group (WHATWG).

                  

The new standard incorporates features like video playback and drag-and-drop         that have been previously dependent on third-party browser plug-ins such as Adobe         Flash, Microsoft Silverlight, and Google Gears.