1 This repo is for distribution on `npm` and `bower`. The source for this module is in the
2 [main Angular Material repo](https://github.com/angular/material).
3 Please file issues and pull requests against that repo.
5 ## Installing Angular Material
7 You can install this package locally either with `npm`, `jspm`, or `bower`.
12 # To install latest formal release
13 npm install angular-material
15 # To install latest release and update package.json
16 npm install angular-material --save-dev
18 # To install from HEAD of master
19 npm install http://github.com/angular/bower-material/tarball/master
21 # To view all installed package
28 # To install latest formal release
29 jspm install angular-material;
31 # To install from HEAD of master
32 jspm install angular-material=github:angular/bower-material@master;
34 # To view all installed package versions
38 Now you can use `require('angular-material')` when installing with npm or jsmp and using Browserify or Webpack.
43 # To get the latest stable version, use bower from the command line.
44 bower install angular-material
46 # To get the most recent, last committed-to-master version use:
47 bower install angular-material#master
49 # To save the bower settings for future use:
50 bower install angular-material --save
52 # Later, you can use easily update with:
56 > Please note that Angular Material requires **Angular 1.3.x** or higher.
59 ## Using the Angular Material Library
61 Now that you have installed the Angular libraries, simply include the scripts and
62 stylesheet in your main HTML file, in the order shown in the example below. Note that npm
63 will install the files under `/node_modules/angular-material/` and bower will install them
64 under `/bower_components/angular-material/`.
72 <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no" />
73 <link rel="stylesheet" href="/node_modules/angular-material/angular-material.css">
75 <body ng-app="YourApp">
77 <div ng-controller="YourController">
81 <script src="/node_modules/angular/angular.js"></script>
82 <script src="/node_modules/angular-aria/angular-aria.js"></script>
83 <script src="/node_modules/angular-animate/angular-animate.js"></script>
84 <script src="/node_modules/angular-material/angular-material.js"></script>
87 // Include app dependency on ngMaterial
89 angular.module( 'YourApp', [ 'ngMaterial' ] )
90 .controller("YourController", YourController );
104 <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no" />
105 <link rel="stylesheet" href="/bower_components/angular-material/angular-material.css">
107 <body ng-app="YourApp">
109 <div ng-controller="YourController">
113 <script src="/bower_components/angular/angular.js"></script>
114 <script src="/bower_components/angular-aria/angular-aria.js"></script>
115 <script src="/bower_components/angular-animate/angular-animate.js"></script>
116 <script src="/bower_components/angular-material/angular-material.js"></script>
119 // Include app dependency on ngMaterial
121 angular.module( 'YourApp', [ 'ngMaterial' ] )
122 .controller("YourController", YourController );
132 CDN versions of Angular Material are now available at
133 [Google Hosted Libraries](https://developers.google.com/speed/libraries/devguide#angularmaterial).
135 With the Google CDN, you will not need to download local copies of the distribution files.
136 Instead simply reference the CDN urls to easily use those remote library files.
137 This is especially useful when using online tools such as CodePen, Plunkr, or jsFiddle.
142 <!-- Angular Material CSS now available via Google CDN; version 0.7.1 used here -->
143 <link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/angular_material/0.7.1/angular-material.min.css">
148 <!-- Angular Material Dependencies -->
149 <script src="//cdn.jsdelivr.net/hammerjs/2.0.4/hammer.min.js"></script>
150 <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.6/angular.min.js"></script>
151 <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.6/angular-animate.min.js"></script>
152 <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.6/angular-aria.min.js"></script>
154 <!-- Angular Material Javascript now available via Google CDN; version 0.7.1 used here -->
155 <script src="//ajax.googleapis.com/ajax/libs/angular_material/0.7.1/angular-material.min.js"></script>
160 > Note that the above sample references the 0.7.1 CDN release. Your version will change
161 based on the latest stable release version.
163 Developers seeking the latest, most-current build versions can use [RawGit.com](//rawgit.com) to
164 pull directly from the distribution GitHub
165 [Bower-Material](https://github.com/angular/bower-material) repository:
170 <!-- Angular Material CSS using RawGit to load directly from `bower-material/master` -->
171 <link rel="stylesheet" href="//rawgit.com/angular/bower-material/master/angular-material.css">
176 <!-- Angular Material Dependencies -->
177 <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.6/angular.js"></script>
178 <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.6/angular-animate.js"></script>
179 <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.6/angular-aria.js"></script>
181 <!-- Angular Material Javascript using RawGit to load directly from `bower-material/master` -->
182 <script src="//rawgit.com/angular/bower-material/master/angular-material.js"></script>
187 > Please note that the above RawGit access is intended **ONLY** for development purposes or sharing
188 low-traffic, temporary examples or demos with small numbers of people.
191 ## Jasmine Testing with Angular Material
194 If you are using Angular Material and will be using Jasmine to test your own custom application code, you will need to also load two (2) Angular mock files:
196 * Angular Mocks - **angular-mocks.js** from `/node_modules/angular-mocks/angular-mocks.js`
197 * Angular Material Mocks - **angular-material-mocks.js** from `/node_modules/angular-material/angular-material-mocks.js`
201 Shown below is a karma-configuration file (`karma.conf.js`) sample that may be a useful template for your own testing purposes:<br/><br/>
204 module.exports = function(config) {
208 'test/myApp/**/*.spec.js'
212 'node_modules/angular/angular.js',
213 'node_modules/angular-animate/angular-animate.js',
214 'node_modules/angular-aria/angular-aria.js',
215 'node_modules/angular-material/angular-material.js',
217 'node_modules/angular-mocks/angular-mocks.js',
218 'node_modules/angular-material/angular-material-mocks.js'
223 basePath: __dirname + '/..',
224 frameworks: ['jasmine'],
226 files: LIBS.concat(SRC),
229 reporters: ['progress'],
234 browsers: ['PhantomJS,Chrome']