File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import { AngularTOHPage } from './app.po' ;
2+
3+ describe ( 'angular-hero-cli App' , function ( ) {
4+ let page : AngularTOHPage ;
5+
6+ beforeEach ( ( ) => {
7+ page = new AngularTOHPage ( ) ;
8+ } ) ;
9+
10+ it ( 'Title' , ( ) => {
11+ page . navigateTo ( ) ;
12+ expect ( page . getParagraphText ( ) ) . toEqual ( 'Top Heroes' ) ;
13+ } ) ;
14+ } ) ;
Original file line number Diff line number Diff line change 1- import { Component , Inject } from '@angular/core' ;
1+ import { Component } from '@angular/core' ;
2+ import { Title } from '@angular/platform-browser' ;
23
3- import { APP_CONFIG } from './config/app.config' ;
4- import { IAppConfig } from './config/iapp.config' ;
4+ import { environment } from '../environments/environment' ;
55
66@Component ( {
77 selector : 'toh-app' ,
@@ -11,7 +11,7 @@ import {IAppConfig} from './config/iapp.config';
1111export class AppComponent {
1212 title : string ;
1313
14- constructor ( @ Inject ( APP_CONFIG ) private appConfig : IAppConfig ) {
15- this . title = this . appConfig . title ;
14+ constructor ( private titleService : Title ) {
15+ titleService . setTitle ( environment . title ) ;
1616 }
1717}
Original file line number Diff line number Diff line change @@ -6,7 +6,6 @@ export let APP_CONFIG = new OpaqueToken('app.config');
66
77let heroesRoute = 'heroes' ;
88export const AppConfig : IAppConfig = {
9- title : 'Tour of Heroes' ,
109 routes : {
1110 heroes : heroesRoute ,
1211 heroById : heroesRoute + '/:id'
Original file line number Diff line number Diff line change 11export interface IAppConfig {
22 routes : any ;
33 endpoints : any ;
4- title : string ;
54}
Original file line number Diff line number Diff line change 11export const environment = {
2- production : true
2+ production : true ,
3+ title : 'Tour of heroes in prod'
34} ;
Original file line number Diff line number Diff line change 44// The list of which env maps to which file can be found in `angular-cli.json`.
55
66export const environment = {
7- production : false
7+ production : false ,
8+ title : 'Tour of heroes in dev'
89} ;
You can’t perform that action at this time.
0 commit comments