本文整理汇总了TypeScript中angular2/core.Input函数的典型用法代码示例。如果您正苦于以下问题:TypeScript Input函数的具体用法?TypeScript Input怎么用?TypeScript Input使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Input函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: dominator
@Input() set dominator(count: Number) {
this._viewContainer.clear();
for (let i = 0; i < count; i++) {
this._viewContainer.createEmbeddedView(this._templateRef);
}
}
示例2: porId
@Input('porId')
set porId(newPorId: number) {
this.myPorId = newPorId;
if (newPorId != null) {
this.reloadSections();
}
}
示例3: myUnless
@Input() set myUnless(condition: boolean) {
if (!condition) {
this._viewContainer.createEmbeddedView(this._templateRef);
} else {
this._viewContainer.clear();
}
}
示例4: stepCount
//Setter for stepCount fills array of steps; needed for ngFor loop in template
@Input('step-count') public set stepCount(value:number) {
this._stepCount = value;
var steps = [];
for (var i = 0; i < this._stepCount; i++)
steps.push(i);
this.steps = steps;
}
示例5: stockSymbol
@Input("stock-symbol")
set stockSymbol(value: string) {
this._stockSymbol = value;
if (this._stockSymbol !== undefined) {
console.log(`Sending a Buy order to NASDAQ: ${this.stockSymbol} ${this.quantity}`);
}
}
示例6: model
@Input() set model(value: any) {
this._model = value;
// If a template has already been rendered, set as implicit local
if (this._view != null) {
this.setLocal();
}
}
示例7: steamId
@Input()
set steamId(value: string) {
this._steamId = value;
this.games = [];
if (value) {
this.getGames(value);
}
}
示例8: ngTemplateOutlet
@Input()
set ngTemplateOutlet(templateRef: TemplateRef<Object>) {
if (isPresent(this._insertedViewRef)) {
this._viewContainerRef.remove(this._viewContainerRef.indexOf(this._insertedViewRef));
}
if (isPresent(templateRef)) {
this._insertedViewRef = this._viewContainerRef.createEmbeddedView(templateRef);
}
}
示例9: collapse
@Input()
private set collapse(value:boolean) {
if(value!==undefined){
if(value){
this.hide();
}else {
this.show();
}
}
}
示例10: imageData
@Input()
set imageData(imageData: ImageData) {
if(imageData) {
this.canvas = this.imageCanvas.nativeElement;
this.canvasContext = this.canvas.getContext('2d');
this.canvas.width = imageData.width;
this.canvas.height = imageData.height;
this.canvasContext.putImageData(imageData, 0, 0);
}
}