Skip to content

Commit dec800e

Browse files
committed
chore(package): update to Angular 6
1 parent 965da7f commit dec800e

File tree

4 files changed

+25
-15
lines changed

4 files changed

+25
-15
lines changed

Diff for: templates/app/_package.json

+10-9
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,16 @@
5252
<%# CLIENT %>
5353
"@angularclass/hmr-loader": "^3.0.4",
5454
"reflect-metadata": "^0.1.3",
55-
"rxjs": "^5.5.2",
55+
"rxjs": "^6.0.0",
56+
"rxjs-compat": "^6.0.0",
5657
"zone.js": "^0.8.12",
57-
"@angular/common": "^5.0.1",
58-
"@angular/compiler": "^5.0.1",
59-
"@angular/core": "^5.0.1",
60-
"@angular/forms": "^5.0.1",
61-
"@angular/platform-browser": "^5.0.1",
62-
"@angular/platform-browser-dynamic": "^5.0.1",
63-
"@angular/router": "^5.0.1",
58+
"@angular/common": "^6.0.4",
59+
"@angular/compiler": "^6.0.4",
60+
"@angular/core": "^6.0.4",
61+
"@angular/forms": "^6.0.4",
62+
"@angular/platform-browser": "^6.0.4",
63+
"@angular/platform-browser-dynamic": "^6.0.4",
64+
"@angular/router": "^6.0.4",
6465
<%#"@angular/material": "5.0.0-rc0",%>
6566
"@angularclass/hmr": "^2.1.3",
6667
<%_ if(filters.ts) { -%>
@@ -79,7 +80,7 @@
7980
"@types/selenium-webdriver": "^3.0.3",
8081
"@types/webpack": "^3.0.10",
8182
<%_ } -%>
82-
"angular2-jwt": "^0.2.3",
83+
"@auth0/angular-jwt": "^2.0.0",
8384
<% if(filters.auth) { %>
8485
"angular-validation-match": "^1.9.0",<% } %>
8586
<% if(filters.uirouter) { %>

Diff for: templates/app/client/app/main/main.component.js

+12-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
11
import { Component, OnInit<% if(filters.ws) { %>, OnDestroy<% } %> } from '@angular/core';
22
import { HttpClient } from '@angular/common/http';
33
import 'rxjs/add/operator/map';<% if(filters.ws) { %>
4-
import { SocketService } from '../../components/socket/socket.service';<% } %>
4+
import { SocketService } from '../../components/socket/socket.service';<% } %><% if(filters.ts) { %>
5+
6+
interface Thing {
7+
name: string;
8+
info?: string;
9+
}<% } %><% if(filters.flow) { %>
10+
type Thing = {
11+
name: string;
12+
info?: string;
13+
};<% } %>
514

615
@Component({
716
selector: 'main',
@@ -11,7 +20,7 @@ import { SocketService } from '../../components/socket/socket.service';<% } %>
1120
export class MainComponent implements OnInit<% if(filters.ws) { %>, OnDestroy<% } %> {
1221
<%_ if(filters.ws) { -%>
1322
SocketService;<% } %>
14-
awesomeThings = [];
23+
awesomeThings: Thing[] = [];
1524
<%_ if(filters.models) { -%>
1625
newThing = '';<% } %>
1726

@@ -24,7 +33,7 @@ export class MainComponent implements OnInit<% if(filters.ws) { %>, OnDestroy<%
2433

2534
ngOnInit() {
2635
return this.http.get('/api/things')
27-
.subscribe(things => {
36+
.subscribe((things: Thing[]) => {
2837
this.awesomeThings = things;<% if(filters.ws) { %>
2938
this.SocketService.syncUpdates('thing', this.awesomeThings);<% } %>
3039
});

Diff for: templates/app/client/components/auth(auth)/auth.service.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export class AuthService {
6969
password
7070
})
7171
.toPromise()
72-
.then(res => {
72+
.then((res: {token: string}) => {
7373
localStorage.setItem('id_token', res.token);
7474
return this.UserService.get().toPromise();
7575
})

Diff for: templates/app/client/components/auth(auth)/user.service.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ export class UserService {
2222
}
2323

2424
query(): Observable<UserType[]> {
25-
return this.http.get('/api/users/');
25+
return this.http.get('/api/users/') as Observable<UserType[]>;
2626
}
2727
get(user<% if(filters.ts) { %>: UserType<% } %> = {id: 'me'}): Observable<UserType> {
28-
return this.http.get(`/api/users/${user.id || user._id}`);
28+
return this.http.get(`/api/users/${user.id || user._id}`) as Observable<UserType>;
2929
}
3030
create(user: UserType) {
3131
return this.http.post('/api/users/', user);

0 commit comments

Comments
 (0)