SHARE
TWEET

Untitled

a guest Feb 21st, 2019 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top