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 11import { Component } from '@angular/core' ;
22import { TranslateService } from 'ng2-translate' ;
3+ import { Title } from '@angular/platform-browser' ;
4+
5+ import { environment } from '../environments/environment' ;
36
47@Component ( {
58 selector : 'toh-app' ,
@@ -9,7 +12,10 @@ import {TranslateService} from 'ng2-translate';
912export class AppComponent {
1013 private translateService : TranslateService ;
1114
12- constructor ( translateService : TranslateService ) {
15+ constructor ( translateService : TranslateService ,
16+ private titleService : Title ) {
17+ titleService . setTitle ( environment . title ) ;
18+
1319 this . translateService = translateService ;
1420 this . translateService . setDefaultLang ( 'en' ) ;
1521 this . translateService . use ( 'en' ) ;
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