Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit f823876

Browse files
committedMar 29, 2017
fix(action bar): attach #comment nodes with _addView
#comment nodes should be added as views to 'actionBar' since they are anchors for the elements added by structural directive (*ngIf, *ngFor, etc.) closes #725 # Please enter the commit message for your changes. Lines starting # with '#' will be kept; you may remove them yourself if you want to. # An empty message aborts the commit. # # Date: Wed Mar 29 17:49:06 2017 +0300 # # On branch svlaeva/fix-action-bar # Your branch is up-to-date with 'origin/svlaeva/fix-action-bar'. # # Changes to be committed: # modified: nativescript-angular/directives/action-bar.ts # # Untracked files: # nativescript-angular/yarn.lock # ng-sample/yarn.lock # # Please enter the commit message for your changes. Lines starting # with '#' will be kept; you may remove them yourself if you want to. # An empty message aborts the commit. # # Date: Wed Mar 29 17:49:06 2017 +0300 # # On branch svlaeva/fix-action-bar # Your branch and 'origin/svlaeva/fix-action-bar' have diverged, # and have 1 and 1 different commits each, respectively. # (use "git pull" to merge the remote branch into yours) # # Changes to be committed: # modified: nativescript-angular/directives/action-bar.ts # # Untracked files: # nativescript-angular/yarn.lock # ng-sample/yarn.lock #
1 parent 184f887 commit f823876

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed
 

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

+6-3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import { Page } from "ui/page";
55
import { View } from "ui/core/view";
66
import { registerElement, ViewClassMeta, NgView } from "../element-registry";
77

8-
let actionBarMeta: ViewClassMeta = {
8+
const actionBarMeta: ViewClassMeta = {
99
skipAddToDom: true,
10-
insertChild: (parent: NgView, child: NgView, _atIndex: number) => {
10+
insertChild: (parent: NgView, child: NgView, atIndex: number) => {
1111
const bar = <ActionBar>(<any>parent);
1212
const childView = <any>child;
1313

@@ -17,13 +17,16 @@ let actionBarMeta: ViewClassMeta = {
1717
} else if (child instanceof ActionItem) {
1818
bar.actionItems.addItem(childView);
1919
childView.parent = bar;
20-
} else if (child.nodeName !== "#text" && child instanceof View) {
20+
} else if (child.nodeName === "#comment") {
21+
bar._addView(childView, atIndex);
22+
} else if (child instanceof View) {
2123
bar.titleView = childView;
2224
}
2325
},
2426
removeChild: (parent: NgView, child: NgView) => {
2527
const bar = <ActionBar>(<any>parent);
2628
const childView = <any>child;
29+
2730
if (child instanceof NavigationButton) {
2831
if (bar.navigationButton === childView) {
2932
bar.navigationButton = null;

0 commit comments

Comments
 (0)
Please sign in to comment.