Skip to content

Commit

Permalink
fix(angular): change detection in deep ViewContainers
Browse files Browse the repository at this point in the history
  • Loading branch information
manucorporat committed Apr 10, 2018
1 parent 4d23cba commit 850d7fc
Show file tree
Hide file tree
Showing 10 changed files with 182 additions and 172 deletions.
7 changes: 4 additions & 3 deletions angular/src/directives/navigation/nav-delegate.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ComponentFactoryResolver, Directive, ElementRef, Injector } from '@angular/core';
import { ComponentFactoryResolver, Directive, ElementRef, Injector, ViewContainerRef } from '@angular/core';
import { AngularDelegate } from '../../providers/angular-delegate';

@Directive({
Expand All @@ -7,10 +7,11 @@ import { AngularDelegate } from '../../providers/angular-delegate';
export class NavDelegate {
constructor(
ref: ElementRef,
cfr: ComponentFactoryResolver,
resolver: ComponentFactoryResolver,
injector: Injector,
angularDelegate: AngularDelegate,
location: ViewContainerRef
) {
ref.nativeElement.delegate = angularDelegate.create(cfr, injector);
ref.nativeElement.delegate = angularDelegate.create(resolver, injector, location);
}
}
3 changes: 1 addition & 2 deletions angular/src/directives/navigation/router-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ export class StackController {

pop(deep: number) {
const view = this.views[this.views.length - deep - 1];
this.navCtrl.setGoback();
this.router.navigateByUrl(view.url);
this.navCtrl.goBack(view.url);
}

private insertView(enteringView: RouteView, forcedGoBack: boolean): boolean {
Expand Down
7 changes: 4 additions & 3 deletions angular/src/directives/navigation/tab-delegate.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ComponentFactoryResolver, Directive, ElementRef, HostListener, Injector } from '@angular/core';
import { ComponentFactoryResolver, Directive, ElementRef, HostListener, Injector, ViewContainerRef } from '@angular/core';
import { AngularDelegate } from '../../providers/angular-delegate';


Expand All @@ -9,11 +9,12 @@ export class TabDelegate {

constructor(
private elementRef: ElementRef,
cfr: ComponentFactoryResolver,
resolver: ComponentFactoryResolver,
injector: Injector,
angularDelegate: AngularDelegate,
location: ViewContainerRef
) {
elementRef.nativeElement.delegate = angularDelegate.create(cfr, injector);
elementRef.nativeElement.delegate = angularDelegate.create(resolver, injector, location);
}

@HostListener('ionRouterOutletActivated', ['$event'])
Expand Down
Loading

0 comments on commit 850d7fc

Please sign in to comment.