Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- export interface TestInterface {
- propertyExists: boolean;
- }
- @Component({
- selector: 'app-root',
- templateUrl: './app.component.html',
- styleUrls: ['./app.component.css']
- })
- export class AppComponent {
- test: TestInterface;
- constructor() {
- this.test = {
- propertyExists: true
- };
- }
- }
- <p>
- Property exists: {{ test.propertyExists }}
- </p>
- <p *ngIf="true">
- Property does not exist: {{ test.propertyDoesNotExist }}
- </p>
- <p>
- Property does not exist: {{ test.propertyDoesNotExist }}
- </p>
- ERROR in srcappapp.component.html(5,7): : Property 'propertyDoesNotExist'
- does not exist on type 'TestInterface'.
- Identifier 'propertyDoesNotExist' is not defined. 'TestInterface' does not
- contain such a member(undefined)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement