Skip to content

Commit

Permalink
Configure Angular Material #16
Browse files Browse the repository at this point in the history
  • Loading branch information
athlonUA committed Aug 28, 2018
1 parent 55fc1e4 commit ec3bb7e
Show file tree
Hide file tree
Showing 10 changed files with 97 additions and 10 deletions.
18 changes: 14 additions & 4 deletions project/application/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,13 @@
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.app.json",
"assets": ["src/favicon.ico", "src/assets"],
"styles": ["src/styles.scss"],
"scripts": []
"styles": [
"node_modules/material-design-icons/iconfont/material-icons.css",
"src/styles.scss"
],
"scripts": [
"node_modules/hammerjs/hammer.min.js"
]
},
"configurations": {
"production": {
Expand Down Expand Up @@ -70,8 +75,13 @@
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.spec.json",
"karmaConfig": "src/karma.conf.js",
"styles": ["src/styles.scss"],
"scripts": [],
"styles": [
"node_modules/material-design-icons/iconfont/material-icons.css",
"src/styles.scss"
],
"scripts": [
"node_modules/hammerjs/hammer.min.js"
],
"assets": ["src/favicon.ico", "src/assets"]
}
},
Expand Down
46 changes: 43 additions & 3 deletions project/application/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion project/application/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@
},
"private": true,
"dependencies": {
"@angular/animations": "^6.1.0",
"@angular/animations": "^6.1.3",
"@angular/cdk": "^6.4.6",
"@angular/common": "^6.1.0",
"@angular/compiler": "^6.1.0",
"@angular/core": "^6.1.0",
"@angular/forms": "^6.1.0",
"@angular/http": "^6.1.0",
"@angular/material": "^6.4.6",
"@angular/platform-browser": "^6.1.0",
"@angular/platform-browser-dynamic": "^6.1.0",
"@angular/platform-server": "^6.1.0",
Expand All @@ -33,8 +35,11 @@
"domino": "^2.1.0",
"es5-shim": "^4.5.10",
"es6-shim": "^0.35.3",
"hammerjs": "^2.0.8",
"material-design-icons": "^3.0.1",
"rxjs": "^6.0.0",
"ts-loader": "^4.4.2",
"webpack-node-externals": "^1.7.2",
"zone.js": "~0.8.26"
},
"devDependencies": {
Expand Down
2 changes: 2 additions & 0 deletions project/application/src/app/modules/core/core.module.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import { NgModule } from '@angular/core';
import { BrowserModule, BrowserTransferStateModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';

import { RoutingModule } from '../routing/routing.module';

@NgModule({
imports: [
BrowserModule.withServerTransition({ appId: 'angular-universal' }),
BrowserTransferStateModule,
BrowserAnimationsModule,
RoutingModule,
],
})
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { NgModule } from '@angular/core';
import { MatButtonModule } from '@angular/material';

@NgModule({
imports: [MatButtonModule],
exports: [MatButtonModule],
})
export class CustomMaterialModule {}
9 changes: 9 additions & 0 deletions project/application/src/app/modules/home/home.component.html
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
<h1>{{ title }}</h1>

<div class="button-row">
<button mat-raised-button>Basic</button>
<button mat-raised-button color="primary">Primary</button>
<button mat-raised-button color="accent">Accent</button>
<button mat-raised-button color="warn">Warn</button>
<button mat-raised-button disabled>Disabled</button>
<a mat-raised-button routerLink=".">Link</a>
</div>
5 changes: 5 additions & 0 deletions project/application/src/app/modules/home/home.component.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.button-row {
button, a {
margin-right: 8px;
}
}
3 changes: 2 additions & 1 deletion project/application/src/app/modules/home/home.module.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { NgModule } from '@angular/core';

import { HomeRoutingModule } from './home-routing.module';
import { CustomMaterialModule } from '../custom-material/custom-material.module';
import { HomeComponent } from './home.component';

@NgModule({
imports: [HomeRoutingModule],
imports: [HomeRoutingModule, CustomMaterialModule],
declarations: [HomeComponent],
})
export class HomeModule {}
1 change: 1 addition & 0 deletions project/application/src/styles.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@import "~@angular/material/prebuilt-themes/indigo-pink.css";
8 changes: 7 additions & 1 deletion project/application/webpack.server.config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
const path = require('path');
const webpack = require('webpack');
const nodeExternals = require('webpack-node-externals');

module.exports = {
entry: { server: './server.ts' },
resolve: { extensions: ['.js', '.ts'] },
target: 'node',
mode: 'none',
// this makes sure we include node_modules and other 3rd party libraries
externals: [/node_modules/],
externals: [
/node_modules/,
nodeExternals({
whitelist: [/^hammerjs/],
}),
],
output: {
path: path.join(__dirname, 'tmp'),
filename: '[name].js',
Expand Down

0 comments on commit ec3bb7e

Please sign in to comment.