Skip to content

Instantly share code, notes, and snippets.

@AustinMatherne
Created October 2, 2017 21:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AustinMatherne/8b92c4de5d2e5679710c7857df47a012 to your computer and use it in GitHub Desktop.
Save AustinMatherne/8b92c4de5d2e5679710c7857df47a012 to your computer and use it in GitHub Desktop.
ngIf Data Binding Removal
import {Observable} from 'rxjs/Observable';
import {of} from 'rxjs/observable/of';
@Component({
selector: 'my-app',
template: `
<ng-container *ngIf="data$ | async as data"> <!-- removed from dom -->
<div>
Data: {{data}} <!-- removed from dom -->
</div>
<div>
Data: {{data}} <!-- removed from dom -->
</div>
</ng-container>
`,
})
export class App {
data$: Observable<boolean> = of(false);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment