
This commit removes all markers from the inline template in `AppComponent` and external template in `TemplateReference`. Test scenarios should be colocated with the test cases themselves. Besides, many existing cases are invalid. For example, if we want to test autocomplete for HTML element, the existing test case is like: ``` <~{cursor} h1> ``` This doesn't make much sense, becasue the language service already sees the `h1` tag in the template. The correct test case should be: ``` <~{cursor ``` IMO, this reflects the real-world use case better. This commit also uncovers a bug in the way HTML entities autocompletion is done. There's an off-by-one error in which a cursor that immediately trails the ampersand character fails to trigger HTML entities autocompletion. PR Close #37475
28 lines
559 B
TypeScript
28 lines
559 B
TypeScript
/**
|
|
* @license
|
|
* Copyright Google LLC 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 Hero {
|
|
id: number;
|
|
name: string;
|
|
}
|
|
|
|
@Component({
|
|
selector: 'my-app',
|
|
template: `
|
|
<h1>{{title}}</h1>
|
|
<h2>{{hero.name}} details!</h2>
|
|
`
|
|
})
|
|
export class AppComponent {
|
|
title = 'Tour of Heroes';
|
|
hero: Hero = {id: 1, name: 'Windstorm'};
|
|
private internal: string = 'internal';
|
|
}
|