angular-components

    9熱度

    3回答

    我有角4的組件被稱爲三次。在模板元數據中,我有一個帶有一些綁定的指令div。 @import {gServ} from '../gServ.service'; @Component: ({ selector: 'sr-comp', template: `<div gDirective [cOptions]="dataChart">` }) export class S

    3熱度

    2回答

    我試圖創建一個接受多個模板作爲輸入的組件。這是我的例子: @Component({ selector: 'data-list', styles: [ require('./data-list.component.scss') ], template: ` <ng-template *ngFor="let item of

    0熱度

    1回答

    假設我有一個元素列表。第一個是課程,第二個是考試,第三個是課程,第四個是課程。 我想顯示此列表。所以我用* ngFor做了一個循環,並且我的列表項有3個不同的組件。 我正在尋找最佳解決方案。 <div *ngFor="let item of items"> <course [item]="item" *ngIf="item.type == 1"></course> <exam

    2熱度

    2回答

    如果在路由器中使用子組件,並通過綁定更新它們,我該如何共享變量? 這是(部分)我的代碼: app_component.dart: import 'package:angular2/core.dart'; import 'package:angular2_components/angular2_components.dart'; import 'package:angular2/router.d

    0熱度

    1回答

    我正在建立一個分隔的框作爲angular 2 components上傳照片到服務器,然後如果從服務器接收成功,然後發送一個請求,創建一個記錄在分貝。結構很簡單,下面介紹。可以有n孩子的,當用戶點擊一個按鈕上傳所有我需要調用每個孩子的上傳方法。通常我會使用服務和subscribe方法,但我想添加隊列以防止服務器超載。有沒有什麼辦法在這個組件邏輯中實現它? <parent> <child>

    15熱度

    3回答

    注意:爲了簡單起見,考慮部件的深度爲: - Smart (grand)parent level 0 - dumb child level 1 .... - dumb grandchild level 2 ....) 有多種方案和條件如何智能/隆重/父/子組件在多層(至少3層)鏈上進行通信並傳遞數據。我們希望保留我們的'聰明'(大)父母組件作爲唯一可以訪

    0熱度

    1回答

    我有一個「角色2」中的「應用程序/英雄」下定義的「英雄」組件。英雄組件爲「hero.component.html 「,」hero.component.css「和」hero.component.ts「文件。 templateUrl工作正常,但styleUrls不加載。將顯示資源未找到錯誤。我將此鏈接https://angular.io/docs/ts/latest/guide/component-s

    1熱度

    1回答

    嗯......我有這樣的一個子組件: this.event.emit(true); this.calendarProviderService.addEvent(newEvent).subscribe( finished => { if (finished == true) { console.log (finished); this.event.e

    0熱度

    1回答

    我收到以下錯誤。 addControl具有以下簽名。不知道我做錯了什麼。 (method) FormGroup.addControl(name: string, control: AbstractControl): void

    1熱度

    1回答

    我想製作牆,並且我有3種不同的牆貼類型。 文本 照片 視頻 什麼是最好的做法是什麼? 3個不同的組件,或1個組件3個內部? 如何在我的* ngFor中選擇正確的組件? <div *ngFor="let post of posts"> <text-post *ngIf="post.type == 1"></text-post> <photo-post *ngIf="post.ty