Angular2: rendering / reloading a component's template

前端 未结 3 2060
无人共我
无人共我 2021-01-03 02:13

Ideally I would need to reload / rerender my component\'s template but if there is a better way to do this I will gladly implement it.

Desired behavior:

3条回答
  •  滥情空心
    2021-01-03 02:33

    Try using ChangeDetectorRef.detectChanges() - it works much like $scope.$digest() from Angular 1.

    Note: ChangeDetectorRef must be injected into the component.

提交回复
热议问题