Skip to content

Commit 8c40ec6

Browse files
committed
Merge pull request NativeScript#193 from NativeScript/action-bar-crash
Fix crashing ActionBar in IOS
2 parents c9c0567 + 9d987b3 commit 8c40ec6

File tree

4 files changed

+7
-12
lines changed

4 files changed

+7
-12
lines changed

ng-sample/app/app.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ nativeScriptBootstrap(RendererTest).then((compRef) => {
4141
//nativeScriptBootstrap(ImageTest);
4242
//nativeScriptBootstrap(NavigationTest, [NS_ROUTER_PROVIDERS]);
4343
// nativeScriptBootstrap(ActionBarTest, [NS_ROUTER_PROVIDERS], { startPageActionBarHidden: false });
44+
// nativeScriptBootstrap(ActionBarTest, [NS_ROUTER_PROVIDERS]);
4445
// nativeScriptBootstrap(ModalTest);
4546
// nativeScriptBootstrap(PlatfromDirectivesTest);
4647
// nativeScriptBootstrap(RouterOutletTest, [NS_ROUTER_PROVIDERS]);

ng-sample/app/examples/action-bar/action-bar-test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,6 @@ class SecondComponent {
7575
}
7676
}
7777

78-
79-
8078
@Component({
8179
selector: 'action-bar-test',
8280
directives: [NS_ROUTER_DIRECTIVES],

ng-sample/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"tns-core-modules": "^2.0.0-angular-4",
2727
"nativescript-intl": "^0.0.2",
2828
"angular2": "2.0.0-beta.14",
29-
"es6-shim": "^0.35.0",
29+
"es6-shim": "^0.35.0",
3030
"parse5": "1.4.2",
3131
"punycode": "1.3.2",
3232
"querystring": "0.2.0",
@@ -49,6 +49,9 @@
4949
"id": "org.nativescript.ngsample",
5050
"tns-android": {
5151
"version": "1.7.1"
52+
},
53+
"tns-ios": {
54+
"version": "1.7.0"
5255
}
5356
}
5457
}

src/nativescript-angular/directives/action-bar.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,6 @@ registerElement("NavigationButton", () => require("ui/action-bar").NavigationBut
5050
})
5151
export class ActionBarComponent {
5252
constructor(public element: ElementRef, private page: Page) {
53-
}
54-
55-
ngOnInit() {
5653
if (isBlank(this.page.actionBarHidden)) {
5754
this.page.actionBarHidden = false;
5855
}
@@ -94,13 +91,11 @@ export class ActionBarScope {
9491
})
9592
export class ActionItemDirective {
9693
constructor(public element: ElementRef, @Optional() private ownerScope: ActionBarScope) {
97-
}
98-
99-
ngOnInit() {
10094
if (this.ownerScope) {
10195
this.ownerScope.onActionInit(this);
10296
}
10397
}
98+
10499
ngOnDestroy() {
105100
if (this.ownerScope) {
106101
this.ownerScope.onActionDestroy(this);
@@ -113,13 +108,11 @@ export class ActionItemDirective {
113108
})
114109
export class NavigationButtonDirective {
115110
constructor(public element: ElementRef, @Optional() private ownerScope: ActionBarScope) {
116-
}
117-
118-
ngOnInit() {
119111
if (this.ownerScope) {
120112
this.ownerScope.onNavButtonInit(this);
121113
}
122114
}
115+
123116
ngOnDestroy() {
124117
if (this.ownerScope) {
125118
this.ownerScope.onNavButtonDestroy(this);

0 commit comments

Comments
 (0)