Skip to content

Commit

Permalink
Experiments with zone
Browse files Browse the repository at this point in the history
  • Loading branch information
webprofusion-chrisc committed Jun 20, 2016
1 parent 8c070d8 commit e129eed
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
10 changes: 6 additions & 4 deletions App/Ionic2/ocm-app/app/pages/comment/comment.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Component} from '@angular/core';
import {Component, NgZone} from '@angular/core';
import {NavController, NavParams, Modal, Alert, Loading} from 'ionic-angular';
import {AppManager} from '../../core/ocm/services/AppManager';
import {UserComment} from '../../core/ocm/model/AppModels';
Expand All @@ -15,7 +15,7 @@ export class CommentPage {

commentTypes: any;
checkinTypes: any;
constructor(private navParams: NavParams, public appManager: AppManager, public nav: NavController) {
constructor(private navParams: NavParams, public appManager: AppManager, public nav: NavController, private zone:NgZone) {

this.commentModel = <UserComment>{
ChargePointID: this.navParams.get('id'),
Expand Down Expand Up @@ -52,8 +52,10 @@ export class CommentPage {


this.appManager.submitComment(this.commentModel).then((response) => {
alert("Comment Published.");
this.nav.pop();
alert("Your comment has been Published.");
this.zone.run(()=>{
this.nav.pop();
});
}) /*, (rejection) => {
/*if (rejection == null && rejection.ok && rejection.ok == true) {
this.nav.pop();
Expand Down
2 changes: 1 addition & 1 deletion App/Ionic2/ocm-app/app/pages/search/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<button (click)="locateUser()" *ngIf="appManager.isRequestInProgress==false" clear>
<ion-icon name="locate"></ion-icon>
</button>
<button *ngIf="appManager.isRequestInProgress==true" clear>
<button *ngIf="appManager.isRequestInProgress" clear>
<ion-spinner></ion-spinner>
</button>
</ion-buttons>
Expand Down
9 changes: 6 additions & 3 deletions App/Ionic2/ocm-app/app/pages/signin/signin.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Component} from '@angular/core';
import {Component, NgZone} from '@angular/core';
import {NavController, NavParams, Alert, Loading} from 'ionic-angular';
import {AppManager} from '../../core/ocm/services/AppManager';
import {UserProfile, AsyncResult} from '../../core/ocm/model/AppModels';
Expand All @@ -11,7 +11,7 @@ export class SignInPage {
email: string;
password: string;

constructor(public appManager: AppManager, public nav: NavController, params: NavParams) {
constructor(public appManager: AppManager, public nav: NavController, params: NavParams, private zone:NgZone) {
this.email = "[email protected]";

var currentProfile = <UserProfile>params.get("Profile");
Expand Down Expand Up @@ -40,7 +40,10 @@ export class SignInPage {

localStorage.setItem("authResponse", JSON.stringify(this.appManager.api.authResponse));

this.nav.popToRoot();
this.zone.run(()=>{
this.nav.popToRoot();
});


}, (reason?: AsyncResult) => {

Expand Down

0 comments on commit e129eed

Please sign in to comment.