Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade dependencies, readme, and default to JIT compilation #22

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,32 @@
Simple app that consumes Angular Material 2 components. Built with the `angular-cli`.

See it live: https://material2-app.firebaseapp.com/

## Getting started

Clone this repo

``` bash
git clone https://github.com/jelbourn/material2-app.git my-app
cd my-app
```

Install dependencies

```bash
npm install
```

Start the server!

```
npm start
```

This will run `ng serve` and the project is accessible at: `http://localhost:4200/`

You're all set (:

## AOT/JIT Compilation

By default JIT compilation is enabled. To disable AoT compilation update `/src/main.ts`
23 changes: 12 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,24 @@
},
"private": true,
"dependencies": {
"@angular/common": "^2.0.0",
"@angular/compiler": "^2.0.0",
"@angular/core": "^2.0.0",
"@angular/forms": "^2.0.0",
"@angular/common": "^2.1.2",
"@angular/compiler": "^2.1.2",
"@angular/core": "^2.1.2",
"@angular/forms": "^2.1.2",
"@angular/http": "^2.0.0",
"@angular/platform-browser": "^2.0.0",
"@angular/platform-browser-dynamic": "^2.0.0",
"@angular/material": "2.0.0-alpha.9-3",
"@angular/platform-browser": "^2.1.2",
"@angular/platform-browser-dynamic": "^2.0.0",
"@angular/router": "^3.0.0",
"core-js": "^2.4.0",
"rxjs": "5.0.0-beta.12",
"hammerjs": "^2.0.8",
"rxjs": "^5.0.0-beta.12",
"ts-helpers": "^1.1.1",
"zone.js": "^0.6.21"
"zone.js": "^0.6.26"
},
"devDependencies": {
"@angular/compiler-cli": "^0.6.3",
"@angular/platform-server": "^2.0.0",
"@angular/compiler-cli": "^2.1.2",
"@angular/platform-server": "^2.1.2",
"@types/hammerjs": "^2.0.32",
"@types/jasmine": "^2.2.30",
"angular-cli": "^1.0.0-beta.16",
Expand All @@ -43,6 +44,6 @@
"protractor": "4.0.3",
"ts-node": "1.2.1",
"tslint": "3.13.0",
"typescript": "^2.0.2"
"typescript": "^2.0.6"
}
}
7 changes: 6 additions & 1 deletion src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
Angular Material2 Example App

<span class="app-toolbar-filler"></span>
<button md-button (click)="isDarkTheme = !isDarkTheme">TOGGLE DARK THEME</button>
<md-slide-toggle [(ngModel)]="isDarkTheme">TOGGLE DARK THEME</md-slide-toggle>
</md-toolbar>

<div class="app-content">
Expand All @@ -31,6 +31,11 @@
<md-checkbox [disabled]="true">Disabled</md-checkbox>
</md-card>

<md-card>
<md-slide-toggle > Default Slide Toggle </md-slide-toggle>
<md-slide-toggle disabled> Disabled Slide Toggle </md-slide-toggle>
</md-card>

<md-card>
<md-radio-button name="symbol">Alpha</md-radio-button>
<md-radio-button name="symbol">Beta</md-radio-button>
Expand Down
2 changes: 2 additions & 0 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import {NgModule} from '@angular/core';
import {BrowserModule} from '@angular/platform-browser';
import {FormsModule} from '@angular/forms';
import {MaterialModule} from '@angular/material';
import {Material2AppAppComponent} from './app.component';

@NgModule({
imports: [
BrowserModule,
FormsModule,
MaterialModule.forRoot(),
],
declarations: [Material2AppAppComponent],
Expand Down
12 changes: 6 additions & 6 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ if (environment.production) {
* JIT compile.
*/

// import {platformBrowserDynamic} from '@angular/platform-browser-dynamic';
// import {MaterialAppModule} from './app/app.module';
// platformBrowserDynamic().bootstrapModule(MaterialAppModule);
import {platformBrowserDynamic} from '@angular/platform-browser-dynamic';
import {MaterialAppModule} from './app/app.module';
platformBrowserDynamic().bootstrapModule(MaterialAppModule);


/**
* AoT compile.
* First run `./node_modules/.bin/ngc -p ./src/`
*/

import {platformBrowser} from '@angular/platform-browser';
import {MaterialAppModuleNgFactory} from './aot/app/app.module.ngfactory';
platformBrowser().bootstrapModuleFactory(MaterialAppModuleNgFactory);
// import {platformBrowser} from '@angular/platform-browser';
// import {MaterialAppModuleNgFactory} from './aot/app/app.module.ngfactory';
// platformBrowser().bootstrapModuleFactory(MaterialAppModuleNgFactory);
2 changes: 2 additions & 0 deletions src/polyfills.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ import 'core-js/es6/reflect';

import 'core-js/es7/reflect';
import 'zone.js/dist/zone';

import 'hammerjs';