Skip to content
This repository was archived by the owner on Jan 13, 2025. It is now read-only.

Commit 781a0b4

Browse files
fix(framework-examples): Fix Angular2 example (#123)
Resolves #119 [ci skip]
1 parent fa926db commit 781a0b4

File tree

6 files changed

+13
-16
lines changed

6 files changed

+13
-16
lines changed

framework-examples/angular2/package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141
"@angular/platform-browser": "^2.0.1",
4242
"@angular/platform-browser-dynamic": "^2.0.1",
4343
"@angular/router": "^3.0.1",
44+
"@material/checkbox": "^0.1.0",
45+
"@material/form-field": "^0.1.0",
4446
"core-js": "2.4.1",
4547
"rxjs": "5.0.0-beta.12",
4648
"zone.js": "0.6.23"
@@ -60,6 +62,8 @@
6062
},
6163
"homepage": "https://github.com/angular/angular2-seed#readme",
6264
"babel": {
63-
"presets": ["es2015"]
65+
"presets": [
66+
"es2015"
67+
]
6468
}
6569
}

framework-examples/angular2/src/app/app.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { BrowserModule } from '@angular/platform-browser';
44
import { RouterModule } from '@angular/router';
55

66
import { SeedApp } from './seed-app';
7-
import { appRoutes } from './app.routs';
7+
import { appRoutes } from './app.routes';
88
import { Home } from './components/home';
99
import { FormFieldModule } from './components/form-field';
1010
import { CheckboxModule } from './components/checkbox';

framework-examples/angular2/src/app/components/checkbox/checkbox.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ import {
3333
import {NG_VALUE_ACCESSOR, ControlValueAccessor} from '@angular/forms';
3434

3535
// Since we don't have typings (yet) we require mdc-checkbox manually.
36-
const {MDCCheckboxFoundation} = require('mdc-checkbox');
36+
const {MDCCheckboxFoundation} = require('@material/checkbox');
3737
// Use webpack's require function to load the css
38-
const MDC_CHECKBOX_STYLES = require('mdc-checkbox-styles');
38+
const MDC_CHECKBOX_STYLES = require('@material/checkbox/mdc-checkbox.scss');
3939

4040
// Needed for ngModel to work properly.
4141
export const MD_CHECKBOX_CONTROL_VALUE_ACCESSOR: Provider = {

framework-examples/angular2/src/app/components/form-field/form-field.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
import {Component, HostBinding, Input, ViewEncapsulation} from '@angular/core';
1818

19-
const MDC_FORM_FIELD_STYLES = require('mdc-form-field-styles');
19+
const MDC_FORM_FIELD_STYLES = require('@material/form-field/mdc-form-field.scss');
2020

2121
@Component({
2222
selector: 'mdc-form-field',

framework-examples/angular2/webpack.config.js

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
/* eslint-disable */
1818
var webpack = require('webpack');
1919
var path = require('path');
20+
var MDC_DIR = path.resolve(__dirname, 'node_modules', '@material');
2021

2122

2223
// Webpack Config
@@ -43,29 +44,21 @@ var webpackConfig = {
4344
test: /\.js$/,
4445
loader: 'babel-loader',
4546
include: [
46-
path.resolve('../../packages')
47+
MDC_DIR
4748
]
4849
},
4950
{
5051
test: /\.scss$/,
5152
loader: 'css-loader!postcss-loader!sass-loader',
5253
include: [
53-
path.resolve('../../packages')
54+
MDC_DIR
5455
]
5556
}
5657
]
5758
},
5859

5960
sassLoader: {
60-
includePaths: [path.resolve('../../packages')]
61-
},
62-
63-
resolve: {
64-
alias: {
65-
'mdc-checkbox': path.resolve('../../packages/mdc-checkbox/index.js'),
66-
'mdc-checkbox-styles': path.resolve('../../packages/mdc-checkbox/mdc-checkbox.scss'),
67-
'mdc-form-field-styles': path.resolve('../../packages/mdc-form-field/mdc-form-field.scss')
68-
}
61+
includePaths: [path.resolve('./node_modules')]
6962
}
7063
};
7164

0 commit comments

Comments
 (0)