typescript

    0熱度

    1回答

    我正在研究一個小API,我想嘗試使用HTTP PATCH REQUEST來更新數據,而不使用一堆if語句。我試圖用變化的數據填充傳出的數據對象。 update() { let prop1 = hasBeenChanged.prop1 ? changedData.prop1 : null; // ... let propN = hasBeenChanged.propN

    1熱度

    1回答

    我們試圖找出打字稿的特殊行爲。在以下兩個代碼示例中,jQuery對象應該通過打字稿進行更改。在工作正常的例子中,我們在實例化了typescript類後,通過在方法中使用選擇器引擎來引用jQuery對象。這工作: namespace Company.Module { export class GenericService { private statefulObject: JQ

    0熱度

    2回答

    我有一個ng格式的組件。我想動態地設置ng表單的名稱,這樣我就可以輕鬆地訪問組件的ng元素值。 例子: <form name="formName"> <component name="componentName"></component> </form> 和組件裏面我有 <ng-form name="{{$ctrl.name}}"> // Some inputs with special

    -1熱度

    1回答

    Im使用redux,用於將組件的展開事件分派到另一個組件。 這些部件用於在表內: <table class="table table-bordered"> <thead> <tr> <th *ngFor="let business of businesses"> <app-business-header-cell [business]="busine

    2熱度

    1回答

    Obeservable功能example.component.ts public name: string; this._cm.getData().subscribe( response => { this.name = response.name; }, error => { this.name = undefined; }

    0熱度

    1回答

    我在看這個:https://github.com/mgechev/angular-seed以便了解最基本形式的Angular Module System。 在這個種子項目中有一個SharedModule,它既有index.ts也有shared.module.ts。在shared.module.ts它做出口Angular方式 - 與指令,出口,提供商等。在index.ts它重新出口它們。在app.m

    -1熱度

    3回答

    我有此打字稿類(減小爲簡單起見): class Dictionary<T> { items = []; add(item: T) { this.items.push(item); } ... more code here ... } 當我實例化一個variabel var channels = new Dictionary<Chan

    5熱度

    2回答

    我正在嘗試使用從獲取請求中檢索到的信息填充引導樣式表。 我得到的信息很好,但它沒有以期望的方式輸出。 這是我的代碼; 視圖分量 <div class="col-md-12"> <table class="table table-striped"> <thead> <tr> <th>Name</th> </tr> </th

    0熱度

    1回答

    我有一個表格的主頁,當點擊一行時,它使用@Output發送出該行的數據(我已經確認數據正在正確發送在項目的另一個地方使用它)。然後,當我點擊下方左側的「數據點信息」按鈕時,彈出一個Bootstrap 4模式。我需要做的是從點擊的行中獲取數據,並使用它在模態中填充表單。 主頁: 模態: HTML的模式: <div class="modal fade" id="myModal2" tabindex="

    1熱度

    2回答

    我想通過在.ts文件中放置一個斷點來調試我的angular2應用程序與源映射。 foo(){ //breakpoint here console.log('bar'); } 只有在加載該組件時而不是在執行時纔會觸發斷點。 有什麼想法?