我寻找这个问题的答案,但我仍然卡住我有一个多行的表,每行有一个复选框,我需要一个复选框来选择所有并取消全选,这里有一些示例代码模板:
<table class="table table-bordered table-condensed table-striped table-hover">
<thead>
<tr>
<th></th>
<th>Size</th>
<th>Diameter</th>
<th class="text-center">
<input type="checkbox" name="all" (change)="checkAll($event)"/>
</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let size of sizes | async ; let i = index">
<td class="text-right">{{i + 1}}</td>
<td class="text-right">{{size.size}}</td>
<td>{{size.diameter}}</td>
<td class="text-center">
<input type="checkbox" name="sizecb[]" value="{{size.id}}"/>
</td>
</tr>
</tbody>
Run Code Online (Sandbox Code Playgroud)
零件:
export class ListSizeComponent implements OnInit {
constructor () {
}
sizes: any;
setSizes() {
this.sizes = [
{'size': '0', 'diameter': '16000 km'},
{'size': '1', 'diameter': '32000 km'}
]
} …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用 REDUX 模式构建我的下一个 Angular 应用程序,但由于某种原因我无法导入所需的库。
应用程序模块.ts
imports: [
BrowserModule,
FormsModule,
HttpModule,
StoreModule.forRoot({
user
})
],
Run Code Online (Sandbox Code Playgroud)
在新的 Angular 安装或我原来的应用程序上,我不断收到这些错误
ERROR in
C:/Users/Jason/projects/NATION5/nation5/node_modules/@ngrx/store/src/models.d.ts (6,52): ',' expected.
C:/Users/Jason/projects/NATION5/nation5/node_modules/@ngrx/store/src/models.d.ts (9,58): ',' expected.
C:/Users/Jason/projects/NATION5/nation5/node_modules/@ngrx/store/src/models.d.ts (12,59): ',' expected.
C:/Users/Jason/projects/NATION5/nation5/node_modules/@ngrx/store/src/models.d.ts (15,51): ',' expected.
C:/Users/Jason/projects/NATION5/nation5/node_modules/@ngrx/store/src/models.d.ts (10,21): Generic type 'ActionReducer<T, V, Action>' requires 3 type argument(s).
C:/Users/Jason/projects/NATION5/nation5/node_modules/@ngrx/store/src/models.d.ts (13,18): Generic type 'ActionReducerMap' requires 3 type argument(s).
C:/Users/Jason/projects/NATION5/nation5/node_modules/@ngrx/store/src/models.d.ts (13,75): Generic type 'ActionReducer<T, V, Action>' requires 3 type argument(s).
C:/Users/Jason/projects/NATION5/nation5/node_modules/@ngrx/store/src/models.d.ts (17,15): Generic type 'ActionReducerMap' requires 3 type argument(s).
C:/Users/Jason/projects/NATION5/nation5/node_modules/@ngrx/store/src/models.d.ts (17,40): Generic type …Run Code Online (Sandbox Code Playgroud)