Category : angular

Is it possible to iterate TemplateRefs from TemplateRef? <my-component [template]="template"></my-component> <ng-template #template> <ng-template *ngFor="let field of fields"> bla bla bla </div> </ng-template> I want to do something like this. @Input() template: TemplateRef<any> and into the template something like this <div *ngFor="let x of template"> <h1>Bla bla bla</h1> <div *ngTemplateOutlet="x"></div> </div> Source: Angular..

Read more

I have a subscription to get parameters come with the route and in that subscription(after it success) I am calling another subscription from the same service to get message details. the problem is: when the parameter changed the subscription that related with old parameter still alive. this.routes.params.subscribe(param => { this.isLoading = true; this.messageId = param[‘id’]; ..

Read more

I have this grid options : gridOptions: GridOptions = { suppressFieldDotNotation: true, paginationAutoPageSize: false, paginationPageSize: 10, domLayout: ‘autoHeight’, rowMultiSelectWithClick: false, rowSelection: ‘multiple’, onFilterChanged: (event) => this.onFilterChanged(event), onCellValueChanged: (event) => this.onCellValueChanged(event) } as GridOptions; On cell value i have this: onCellValueChanged(event) { if (typeof event.newValue === ‘string’) { this.toastrService.error(event.newValue + ‘ is not a number!’); return; ..

Read more

i am calling handleStopRecording() function but i am getting error ERROR TypeError: Cannot read property ‘handleStopRecording’ of undefined stream.getTracks().forEach(function (track) { track.addEventListener( "ended", function () { callback(); callback = function () { console.log("stop recording") this.handleStopRecording() }; }, false ); track.addEventListener( "inactive", function () { callback(); callback = function () { console.log("end"); }; }, false ); ..

Read more