Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions GETTING_STARTED.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,34 @@ import { MaterialModule } from '@angular/material';
export class PizzaPartyAppModule { }
```

## Tell to System loader where Angular Material is located
This is **required** step. You need to tell to system loader where angular material is located otherwise
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Configuring SystemJS is only necessary if you're using SystemJS. If you're using Webpack (such as with angular-cli) or something like Browserify, RequireJS etc., this isn't necessary.

I'm okay with adding something on SystemJS since the angular quickstart uses it, but it should be further down (since not all projects use it). I'd put it as something like:

## Configuring SystemJS
If your project is using SystemJS for module loading, you will need to add `@angular/material` to the SystemJS configuration:
System.config({
  // existing configuration options
  map: {
    ...,
    '@angular/material': 'npm:@angular/material/material.umd.js'
  }
});

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jelbourn Thank you. I think that would be a good addition to getting started file, because there are lots of beginners who would use Systemjs with their Angular 2 application. That is also good description that you have added in code below. So let's go with it.

material2 can't be loaded.

```js
System.config({
defaultJSExtensions: true,
paths: {
'npm:': './'
},
map: {
app: 'app',

'@angular/core': 'npm:@angular/core/bundles/core.umd.js',
'@angular/common': 'npm:@angular/common/bundles/common.umd.js',
'@angular/compiler': 'npm:@angular/compiler/bundles/compiler.umd.js',
'@angular/platform-browser': 'npm:@angular/platform-browser/bundles/platform-browser.umd.js',
'@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',
'@angular/http': 'npm:@angular/http/bundles/http.umd.js',
'@angular/router': 'npm:@angular/router/bundles/router.umd.js',
'@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js',
'@angular/material': 'npm:@angular/material/material.umd.js', //Add this line

'rxjs': 'npm:rxjs'
}
});
```

## Include the core and theme styles:
This is **required** to apply all of the core and theme styles to your application. You can either
use a pre-built theme, or define your own custom theme.
Expand Down