本文整理汇总了TypeScript中angular2/core.QueryList类的典型用法代码示例。如果您正苦于以下问题:TypeScript QueryList类的具体用法?TypeScript QueryList怎么用?TypeScript QueryList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了QueryList类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: noteOn
noteOn(note: any) {
console.log('simple synth play note called ' + note);
let volume = 1 / this.oscComponents.toArray().length;
for (let osc of this.oscComponents.toArray()) {
osc.start(note, volume, this.master);
}
}
示例2: 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);
}
}
示例3: ngAfterContentInit
ngAfterContentInit() {
let activeTabs = this.tabs.filter((tab) => tab.active);
if (activeTabs.length === 0) {
this.selectTab(this.tabs.first);
}
}
示例4: noteOff
noteOff(freq){
console.log('simple synth note off called ');
for (let osc of this.oscComponents.toArray()) {
console.log('simple synth note off stop osc ');
osc.stop(freq, this.master);
}
}
示例5: selectTab
selectTab(tab: Tab) {
// deactivate all tabs
this.tabs.toArray().forEach( tab1 => tab1.active = false);
// activate the tab the user has clicked on.
tab.active = true;
}
示例6: _deactivateAllTabs
selectTab(tab: ChartOfAccountsTab) {
_deactivateAllTabs(this.tabs.toArray());
tab.active = true;
function _deactivateAllTabs(tabs: ChartOfAccountsTab[]) {
tabs.forEach((tab)=>tab.active = false);
}
}
示例7: ngAfterContentInit
// contentChildren are set
ngAfterContentInit() {
// get all active tabs
let activeTabs = this.tabs.filter((tab)=>tab.active);
// if there is no active tab set, activate the first
if(activeTabs.length === 0) {
this.selectTab(this.tabs.first);
}
}
示例8: _deactivateAllTabs
selectTab(tab: ProfileTab) {
_deactivateAllTabs(this.tabs.toArray());
tab.active = true;
function _deactivateAllTabs(tabs: ProfileTab[]) {
tabs.forEach((tab)=>tab.active = false);
}
}
示例9: 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;
}
示例10: 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;
}