Skip to content

Commit 2c65a71

Browse files
committed
fix(app): fix all ngc issues
when building prod with the latest Ionic, ngc was firing many issues, which are corrected in this commit.
1 parent 968bb45 commit 2c65a71

File tree

7 files changed

+20
-35
lines changed

7 files changed

+20
-35
lines changed

src/app/app.component.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Component, ViewChild } from '@angular/core';
33
import { Nav, Platform, MenuController } from 'ionic-angular';
44
import { StatusBar } from '@ionic-native/status-bar';
55
import { SplashScreen } from '@ionic-native/splash-screen';
6-
import { Subject } from 'rxjs';
6+
import { Subject } from 'rxjs/Subject';
77

88
@Component({
99
templateUrl: 'app.html'
@@ -17,6 +17,8 @@ export class MyApp {
1717
pages: Array<{ title: string, component: any, active: boolean, icon: string }>;
1818
rightMenuItems: Array<{ icon: string, active: boolean }>;
1919
state: any;
20+
placeholder = 'assets/img/avatar/girl-avatar.png';
21+
chosenPicture: any;
2022

2123
constructor(
2224
public platform: Platform,
@@ -54,8 +56,7 @@ export class MyApp {
5456
{ title: 'Popup Menu', component: 'PopupMenuListPage', active: false, icon: 'beer' },
5557
{ title: 'Profile', component: 'ProfileListPage', active: false, icon: 'camera' },
5658
{ title: 'Side Menu', component: 'SideMenuPage', active: false, icon: 'bookmark' },
57-
// Removed for now as there were breaking changes in slides
58-
{ title: 'Timeline', component: 'TimelinePage', active: false, icon: 'calendar'},
59+
{ title: 'Timeline', component: 'TimelinePage', active: false, icon: 'calendar' },
5960
{ title: 'Slides', component: 'SlidesPage', active: false, icon: 'contact' },
6061
{ title: 'Theming', component: 'ThemingPage', active: false, icon: 'power' },
6162
];

src/app/app.imports.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ import { Autosize } from '../components/autosize/autosize';
2424
// Modules
2525
import { SwingModule } from 'angular2-swing';
2626
import { BrowserModule } from '@angular/platform-browser';
27-
import { HttpModule } from '@angular/http';
27+
import { HttpClientModule } from '@angular/common/http';
2828

2929
export const MODULES = [
3030
SwingModule,
3131
BrowserModule,
32-
HttpModule,
32+
HttpClientModule,
3333
];
3434

3535
export const PROVIDERS = [

src/components/components.module.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { TimelineComponentModule } from './timeline/timeline.module';
12
import { NgModule } from '@angular/core';
23
import { IonicModule } from 'ionic-angular';
34

@@ -6,22 +7,18 @@ import { TimerProgress } from './timer-progress/timer-progress';
67
import { ExpandableHeader } from './expandable-header/expandable-header';
78
import { FlashCardComponent } from './flash-card/flash-card';
89
import { AccordionListComponent } from './accordion-list/accordion-list';
9-
import { TimelineComponent, TimelineItemComponent, TimelineTimeComponent } from './timeline/timeline';
1010

1111
export const components = [
1212
Timer,
1313
TimerProgress,
1414
ExpandableHeader,
1515
FlashCardComponent,
1616
AccordionListComponent,
17-
TimelineComponent,
18-
TimelineItemComponent,
19-
TimelineTimeComponent,
2017
];
2118

2219
@NgModule({
2320
declarations: [components],
2421
imports: [IonicModule],
25-
exports: [components]
22+
exports: [components, TimelineComponentModule]
2623
})
2724
export class ComponentsModule {}

src/components/timeline/timeline.module.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ import {
66
TimelineTimeComponent
77
} from './timeline';
88

9-
export const components = [
10-
];
11-
129
@NgModule({
1310
declarations: [
1411
TimelineComponent,

src/components/timeline/timeline.ts

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,23 @@ import { Component, Input } from '@angular/core';
55
templateUrl: 'timeline.html'
66
})
77
export class TimelineComponent {
8-
@Input('endIcon') endIcon = "ionic";
9-
constructor() {
10-
11-
}
12-
8+
@Input('endIcon') endIcon = 'ionic';
9+
constructor() { }
1310
}
1411

1512
@Component({
1613
selector: 'timeline-item',
1714
template: '<ng-content></ng-content>'
1815
})
1916
export class TimelineItemComponent{
20-
constructor(){
21-
22-
}
17+
constructor() { }
2318
}
2419

25-
2620
@Component({
2721
selector:'timeline-time',
2822
template: '<span>{{time.subtitle}}</span> <span>{{time.title}}</span>'
2923
})
3024
export class TimelineTimeComponent{
31-
@Input('time') time = {};
32-
constructor(){
33-
34-
}
25+
@Input('time') time: { title?: string, subtitle?: string} = {};
26+
constructor() { }
3527
}

src/pages/miscellaneous/flash-card/flash-card.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { NavController, NavParams, IonicPage } from 'ionic-angular';
77
templateUrl: 'flash-card.html'
88
})
99
export class FlashCardPage {
10-
private flashCards = [];
10+
flashCards = [];
1111
constructor(public navCtrl: NavController, public navParams: NavParams) {
1212
this.flashCards = [
1313
{

src/pages/miscellaneous/tinder-cards/tinder-cards.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import { ToastService } from '../../../providers/util/toast.service';
22
import { Component, ViewChild, ViewChildren, QueryList } from '@angular/core';
3-
import { Http } from '@angular/http';
4-
import 'rxjs/Rx';
53

64
import {
75
StackConfig,
@@ -10,6 +8,7 @@ import {
108
SwingCardComponent
119
} from 'angular2-swing';
1210
import { NavController, IonicPage } from 'ionic-angular';
11+
import { HttpClient } from '@angular/common/http';
1312

1413
@IonicPage()
1514
@Component({
@@ -24,7 +23,7 @@ export class TinderCardsPage {
2423
stackConfig: StackConfig;
2524
recentCard: string = '';
2625

27-
constructor(public navCtrl: NavController, public http: Http, public toastCtrl: ToastService) {
26+
constructor(public navCtrl: NavController, public http: HttpClient, public toastCtrl: ToastService) {
2827
this.stackConfig = {
2928
throwOutConfidence: (offset, element: any) => {
3029
return Math.min(Math.abs(offset) / (element.offsetWidth / 2), 1);
@@ -79,9 +78,8 @@ export class TinderCardsPage {
7978
// Add new cards to our array
8079
addNewCards(count: number) {
8180
this.http.get('https://randomuser.me/api/?results=' + count)
82-
.map(data => data.json().results)
83-
.subscribe(result => {
84-
for (const val of result) {
81+
.subscribe((result: any) => {
82+
for (const val of result.results) {
8583
this.cards.push(val);
8684
}
8785
});
@@ -90,9 +88,9 @@ export class TinderCardsPage {
9088
// http://stackoverflow.com/questions/57803/how-to-convert-decimal-to-hex-in-javascript
9189
decimalToHex(d, padding) {
9290
let hex = Number(d).toString(16);
93-
padding = typeof (padding) === 'undefined' || padding === null ? padding = 2 : padding;
91+
const numPadding = typeof (padding) === 'undefined' || padding === null ? 2 : padding;
9492

95-
while (hex.length < padding) {
93+
while (hex.length < numPadding) {
9694
hex = '0' + hex;
9795
}
9896

0 commit comments

Comments
 (0)