Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. export interface TestInterface {
  2. propertyExists: boolean;
  3. }
  4.  
  5. @Component({
  6. selector: 'app-root',
  7. templateUrl: './app.component.html',
  8. styleUrls: ['./app.component.css']
  9. })
  10. export class AppComponent {
  11. test: TestInterface;
  12. constructor() {
  13. this.test = {
  14. propertyExists: true
  15. };
  16. }
  17. }
  18.  
  19. <p>
  20. Property exists: {{ test.propertyExists }}
  21. </p>
  22. <p *ngIf="true">
  23. Property does not exist: {{ test.propertyDoesNotExist }}
  24. </p>
  25.  
  26. <p>
  27. Property does not exist: {{ test.propertyDoesNotExist }}
  28. </p>
  29.  
  30. ERROR in srcappapp.component.html(5,7): : Property 'propertyDoesNotExist'
  31. does not exist on type 'TestInterface'.
  32.  
  33. Identifier 'propertyDoesNotExist' is not defined. 'TestInterface' does not
  34. contain such a member(undefined)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement