本文整理汇总了TypeScript中angular2/core.QueryList.toArray方法的典型用法代码示例。如果您正苦于以下问题:TypeScript QueryList.toArray方法的具体用法?TypeScript QueryList.toArray怎么用?TypeScript QueryList.toArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类angular2/core.QueryList
的用法示例。
在下文中一共展示了QueryList.toArray方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: selectTab
selectTab(tab: Tab){
// deactivate all tabs
this.tabs.toArray().forEach(tab => tab.active = false);
// activate the tab the user has clicked on.
tab.active = true;
}
示例2: selectTab
selectTab(tab: ProfileTab) {
_deactivateAllTabs(this.tabs.toArray());
tab.active = true;
function _deactivateAllTabs(tabs: ProfileTab[]) {
tabs.forEach((tab)=>tab.active = false);
}
}
示例3: selectTab
selectTab(tab: Minitab, event?:MouseEvent){
// deactivate all tabs
event ? event.preventDefault() : null;
this.tabs.toArray().forEach(tab => tab.active = false);
// activate the tab the user has clicked on.
tab.active = true;
}
示例4: selectTab
selectTab(tab: ChartOfAccountsTab) {
_deactivateAllTabs(this.tabs.toArray());
tab.active = true;
function _deactivateAllTabs(tabs: ChartOfAccountsTab[]) {
tabs.forEach((tab)=>tab.active = false);
}
}
示例5: selectTab
selectTab(tab: TabComponent) {
// deactivate all tabs
for (let tab of this.tabs.toArray()) {
tab.isActive = false;
}
// activate the tab the user has clicked on.
tab.isActive = true;
}
示例6: selectTab
selectTab(selectedTab:ng2RoutingTab): void {
// deactivate all tabs
this.tabs.toArray().forEach((tab) => tab.active = false);
// activate the tab the user has clicked on.
selectedTab.active = true;
}
示例7: ngOnChanges
ngOnChanges(changes) {
if (!this.tabs) return;
let localTabsRef = this.tabs.toArray();
if (changes && changes.largeDevice) {
for (let i = 0; i < localTabsRef.length; i++) {
localTabsRef[i].largeDevice = changes.largeDevice.currentValue;
}
}
}
示例8: ngAfterContentInit
ngAfterContentInit(){
//active current Tab
this.tabs.toArray().forEach((tab) => {
let instruction = this._router.generate(tab.tabLink);
if(this._router.isRouteActive(instruction)){
tab.active = true;
}
} );
}
示例9: ngAfterContentInit
ngAfterContentInit() {
let localTabsRef = this.tabs.toArray();
for (let i = 0; i < localTabsRef.length; i++) {
localTabsRef[i].id = 'tab-' + i;
localTabsRef[i].headingId = 'heading-' + localTabsRef[i].id;
localTabsRef[i].largeDevice = this.largeDevice;
}
let activeTabs = this.tabs.filter((tab) => tab.isActive);
// if there is no active tab set, activate the first
if (activeTabs.length === 0) {
this.selectTab(this.tabs.first);
}
}
示例10: selectTab
selectTab(tab: CanvasTab) {
this.tabs.toArray().forEach(tab => tab.active = false);
tab.active = true;
}