Skip to content

Commit dc20bdd

Browse files
committed
Merge branch 'test_angular6'
2 parents 01cfcbd + 3380cdf commit dc20bdd

File tree

13 files changed

+7277
-6353
lines changed

13 files changed

+7277
-6353
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ For a fresh start, consider running these commands
55

66
<a href="https://github.com/damienbod/Angular2WebpackVisualStudio/blob/master/README.md">Readme</a>
77

8+
<a name="2018-05-94"></a>
9+
# 2018-05-04
10+
* Updated packages, angular 6.0.0, .NET 2.0.7
11+
812
<a name="2018-02-23"></a>
913
# 2018-03-14
1014
* Updated packages, angular 5.2.8, .NET 2.0.6

src/AngularWebpackVisualStudio/AngularWebpackVisualStudio.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<TargetFramework>netcoreapp2.0</TargetFramework>
44
</PropertyGroup>
55
<ItemGroup>
6-
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.6" />
6+
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.7" />
77
</ItemGroup>
88
<ItemGroup>
99
<DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="2.0.0" />
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.navigationLinkButton:hover {
2-
cursor: pointer;
2+
cursor: pointer;
33
}
44

55
a {
6-
color: #03A9F4;
6+
color: #03a9f4;
77
}

src/AngularWebpackVisualStudio/angularApp/app/app.routes.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ import { RouterModule, Routes } from '@angular/router';
22

33
export const routes: Routes = [
44
{ path: '', redirectTo: 'home', pathMatch: 'full' },
5-
{
6-
path: 'about', loadChildren: './about/about.module#AboutModule',
7-
}
5+
{ path: 'about', loadChildren: './about/about.module#AboutModule'}
86
];
97

108
export const AppRoutes = RouterModule.forRoot(routes);

src/AngularWebpackVisualStudio/angularApp/app/core/services/thing-data.service.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
import 'rxjs/add/operator/map';
2-
3-
import { HttpClient, HttpHeaders } from '@angular/common/http';
1+
import { HttpClient, HttpHeaders } from '@angular/common/http';
42
import { Injectable } from '@angular/core';
5-
import { Observable } from 'rxjs/Observable';
3+
import { Observable } from 'rxjs';
64

75
import { Configuration } from './../../app.constants';
86
import { Thing } from './../../models/thing';

src/AngularWebpackVisualStudio/angularApp/app/home/components/home.component.ts

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -4,52 +4,52 @@ import { ThingService } from './../../core/services/thing-data.service';
44
import { Thing } from './../../models/thing';
55

66
@Component({
7-
selector: 'app-home-component',
8-
templateUrl: './home.component.html'
7+
selector: 'app-home-component',
8+
templateUrl: './home.component.html'
99
})
10-
1110
export class HomeComponent implements OnInit {
11+
message: string;
12+
things: Thing[] = [];
13+
thing: Thing = new Thing();
1214

13-
message: string;
14-
things: Thing[] = [];
15-
thing: Thing = new Thing();
15+
constructor(private dataService: ThingService) {
16+
this.message = 'Things from the ASP.NET Core API';
17+
}
1618

17-
constructor(private dataService: ThingService) {
18-
this.message = 'Things from the ASP.NET Core API';
19-
}
19+
ngOnInit() {
20+
this.getAllThings();
21+
}
2022

21-
ngOnInit() {
23+
addThing() {
24+
this.dataService.add(this.thing).subscribe(
25+
() => {
2226
this.getAllThings();
23-
}
24-
25-
addThing() {
26-
this.dataService
27-
.add(this.thing)
28-
.subscribe(() => {
29-
this.getAllThings();
30-
this.thing = new Thing();
31-
}, (error) => {
32-
console.log(error);
33-
});
34-
}
35-
36-
deleteThing(thing: Thing) {
37-
this.dataService
38-
.delete(thing.id)
39-
.subscribe(() => {
40-
this.getAllThings();
41-
}, (error) => {
42-
console.log(error);
43-
});
44-
}
45-
46-
private getAllThings() {
47-
this.dataService
48-
.getAll()
49-
.subscribe(
50-
data => this.things = data,
51-
error => console.log(error),
52-
() => console.log('Get all complete')
53-
);
54-
}
27+
this.thing = new Thing();
28+
},
29+
error => {
30+
console.log(error);
31+
}
32+
);
33+
}
34+
35+
deleteThing(thing: Thing) {
36+
this.dataService.delete(thing.id).subscribe(
37+
() => {
38+
this.getAllThings();
39+
},
40+
error => {
41+
console.log(error);
42+
}
43+
);
44+
}
45+
46+
private getAllThings() {
47+
this.dataService
48+
.getAll()
49+
.subscribe(
50+
data => (this.things = data),
51+
error => console.log(error),
52+
() => console.log('Get all complete')
53+
);
54+
}
5555
}

src/AngularWebpackVisualStudio/config/webpack.dev.js

Lines changed: 102 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -14,126 +14,112 @@ const ROOT = path.resolve(__dirname, '..');
1414
console.log('@@@@@@@@@ USING DEVELOPMENT @@@@@@@@@@@@@@@');
1515

1616
module.exports = {
17-
18-
devtool: 'source-map',
19-
performance: {
20-
hints: false
21-
},
22-
entry: {
23-
'polyfills': './angularApp/polyfills.ts',
24-
'vendor': './angularApp/vendor.ts',
25-
'app': './angularApp/main.ts'
17+
mode: 'development',
18+
devtool: 'source-map',
19+
performance: {
20+
hints: false
21+
},
22+
entry: {
23+
polyfills: './angularApp/polyfills.ts',
24+
vendor: './angularApp/vendor.ts',
25+
app: './angularApp/main.ts'
26+
},
27+
28+
output: {
29+
path: ROOT + '/wwwroot/',
30+
filename: 'dist/[name].bundle.js',
31+
chunkFilename: 'dist/[id].chunk.js',
32+
publicPath: '/'
33+
},
34+
35+
resolve: {
36+
extensions: ['.ts', '.js', '.json'],
37+
alias: rxPaths()
38+
},
39+
40+
devServer: {
41+
historyApiFallback: true,
42+
contentBase: path.join(ROOT, '/wwwroot/'),
43+
watchOptions: {
44+
aggregateTimeout: 300,
45+
poll: 1000
46+
}
47+
},
48+
49+
module: {
50+
rules: [
51+
{
52+
test: /\.ts$/,
53+
use: [
54+
'awesome-typescript-loader',
55+
'angular-router-loader',
56+
'angular2-template-loader',
57+
'source-map-loader',
58+
'tslint-loader'
59+
]
60+
},
61+
{
62+
test: /\.(png|jpg|gif|woff|woff2|ttf|svg|eot)$/,
63+
use: 'file-loader?name=assets/[name]-[hash:6].[ext]'
64+
},
65+
{
66+
test: /favicon.ico$/,
67+
use: 'file-loader?name=/[name].[ext]'
68+
},
69+
{
70+
test: /\.css$/,
71+
use: ['style-loader', 'css-loader']
72+
},
73+
{
74+
test: /\.scss$/,
75+
include: path.join(ROOT, 'angularApp/styles'),
76+
use: ['style-loader', 'css-loader', 'sass-loader']
77+
},
78+
{
79+
test: /\.scss$/,
80+
exclude: path.join(ROOT, 'angularApp/styles'),
81+
use: ['raw-loader', 'sass-loader']
82+
},
83+
{
84+
test: /\.html$/,
85+
use: 'raw-loader'
86+
}
87+
],
88+
exprContextCritical: false
89+
},
90+
plugins: [
91+
function() {
92+
this.plugin('watch-run', function(watching, callback) {
93+
console.log(
94+
'\x1b[33m%s\x1b[0m',
95+
`Begin compile at ${new Date().toTimeString()}`
96+
);
97+
callback();
98+
});
2699
},
27100

28-
output: {
29-
path: ROOT + '/wwwroot/',
30-
filename: 'dist/[name].bundle.js',
31-
chunkFilename: 'dist/[id].chunk.js',
32-
publicPath: '/'
33-
},
101+
new webpack.optimize.ModuleConcatenationPlugin(),
34102

35-
resolve: {
36-
extensions: ['.ts', '.js', '.json'],
37-
alias: rxPaths()
38-
},
103+
new webpack.ProvidePlugin({
104+
$: 'jquery',
105+
jQuery: 'jquery',
106+
'window.jQuery': 'jquery'
107+
}),
39108

40-
devServer: {
41-
historyApiFallback: true,
42-
contentBase: path.join(ROOT, '/wwwroot/'),
43-
watchOptions: {
44-
aggregateTimeout: 300,
45-
poll: 1000
46-
}
47-
},
109+
// new webpack.optimize.CommonsChunkPlugin({ name: ['vendor', 'polyfills'] }),
48110

49-
module: {
50-
rules: [
51-
{
52-
test: /\.ts$/,
53-
use: [
54-
'awesome-typescript-loader',
55-
'angular-router-loader',
56-
'angular2-template-loader',
57-
'source-map-loader',
58-
'tslint-loader'
59-
]
60-
},
61-
{
62-
test: /\.(png|jpg|gif|woff|woff2|ttf|svg|eot)$/,
63-
use: 'file-loader?name=assets/[name]-[hash:6].[ext]'
64-
},
65-
{
66-
test: /favicon.ico$/,
67-
use: 'file-loader?name=/[name].[ext]'
68-
},
69-
{
70-
test: /\.css$/,
71-
use: [
72-
'style-loader',
73-
'css-loader'
74-
]
75-
},
76-
{
77-
test: /\.scss$/,
78-
include: path.join(ROOT, 'angularApp/styles'),
79-
use: [
80-
'style-loader',
81-
'css-loader',
82-
'sass-loader'
83-
]
84-
},
85-
{
86-
test: /\.scss$/,
87-
exclude: path.join(ROOT, 'angularApp/styles'),
88-
use: [
89-
'raw-loader',
90-
'sass-loader'
91-
]
92-
},
93-
{
94-
test: /\.html$/,
95-
use: 'raw-loader'
96-
}
97-
],
98-
exprContextCritical: false
99-
},
100-
plugins: [
101-
function() {
102-
this.plugin('watch-run',
103-
function(watching, callback) {
104-
console.log('\x1b[33m%s\x1b[0m', `Begin compile at ${(new Date()).toTimeString()}`);
105-
callback();
106-
});
107-
},
108-
109-
new webpack.optimize.ModuleConcatenationPlugin(),
110-
111-
new webpack.ProvidePlugin({
112-
$: 'jquery',
113-
jQuery: 'jquery',
114-
'window.jQuery': 'jquery'
115-
}),
116-
117-
new webpack.optimize.CommonsChunkPlugin({ name: ['vendor', 'polyfills'] }),
118-
119-
new CleanWebpackPlugin(
120-
[
121-
'./wwwroot/dist',
122-
'./wwwroot/assets'
123-
],
124-
{ root: ROOT }
125-
),
126-
127-
new HtmlWebpackPlugin({
128-
filename: 'index.html',
129-
inject: 'body',
130-
template: 'angularApp/index.html'
131-
}),
132-
133-
new CopyWebpackPlugin([
134-
{ from: './angularApp/images/*.*', to: 'assets/', flatten: true }
135-
])
136-
]
111+
new CleanWebpackPlugin(['./wwwroot/dist', './wwwroot/assets'], {
112+
root: ROOT
113+
}),
137114

138-
};
115+
new HtmlWebpackPlugin({
116+
filename: 'index.html',
117+
inject: 'body',
118+
template: 'angularApp/index.html'
119+
}),
139120

121+
new CopyWebpackPlugin([
122+
{ from: './angularApp/images/*.*', to: 'assets/', flatten: true }
123+
])
124+
]
125+
};

0 commit comments

Comments
 (0)