2019-09-12 18:20:54 -04:00
|
|
|
/**
|
|
|
|
* @license
|
|
|
|
* Copyright Google Inc. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by an MIT-style license that can be
|
|
|
|
* found in the LICENSE file at https://angular.io/license
|
|
|
|
*/
|
|
|
|
|
|
|
|
import {Component} from '@angular/core';
|
|
|
|
|
|
|
|
export interface Person {
|
|
|
|
name: string;
|
|
|
|
age: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Component({
|
2019-10-11 16:56:33 -04:00
|
|
|
template: '{{~{start-foo}foo~{end-foo}}}',
|
2019-09-12 18:20:54 -04:00
|
|
|
})
|
|
|
|
export class WrongFieldReference {
|
|
|
|
bar = 'bar';
|
|
|
|
}
|
|
|
|
|
|
|
|
@Component({
|
2019-10-11 16:56:33 -04:00
|
|
|
template: '{{~{start-nam}person.nam~{end-nam}}}',
|
2019-09-12 18:20:54 -04:00
|
|
|
})
|
|
|
|
export class WrongSubFieldReference {
|
|
|
|
person: Person = {name: 'Bob', age: 23};
|
|
|
|
}
|
|
|
|
|
|
|
|
@Component({
|
2019-10-11 16:56:33 -04:00
|
|
|
template: '{{~{start-myField}myField~{end-myField}}}',
|
2019-09-12 18:20:54 -04:00
|
|
|
})
|
|
|
|
export class PrivateReference {
|
|
|
|
private myField = 'My Field';
|
|
|
|
}
|
|
|
|
|
|
|
|
@Component({
|
2019-10-11 16:56:33 -04:00
|
|
|
template: '{{~{start-mod}"a" ~{end-mod}% 2}}',
|
2019-09-12 18:20:54 -04:00
|
|
|
})
|
|
|
|
export class ExpectNumericType {
|
|
|
|
}
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
template: '{{ (name | lowercase).~{string-pipe}substring }}',
|
|
|
|
})
|
|
|
|
export class LowercasePipe {
|
2019-09-19 20:04:02 -04:00
|
|
|
name: string = 'name';
|
2019-09-12 18:20:54 -04:00
|
|
|
}
|