This commit fixes a bug in which we do testing for completions. Subsequently, this exposes another bug in our implementation whereby suggestions are not provided in "ngFor" where there should have been. Currently, multiple test cases are grouped together in a single template. This requires the template to be somewhat complete so that test cases that depend on variables declared earlier would pass. Consider the following example: ``` template: ` <div *ngFor="let ~{for-person}person of ~{for-people}people"> <span>Name: {{~{for-interp-person}person.~{for-interp-name}name}}</span> <span>Age: {{person.~{for-interp-age}age}}</span> </div>`, ``` In order to test `~{for-interp-person}`, `people` has to be included after `~{for-people}`. This means the test case for `~{for-people}` is not reflective of the actual use case because the variable is already there! In real case, the expression would be incomplete, and our implementation failed to take that into account. This commit breaks such test into individual tests, and fix the bugs in the underlying implementation. PR Close #34473
56 lines
1.6 KiB
TypeScript
56 lines
1.6 KiB
TypeScript
/**
|
|
* @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 {CommonModule} from '@angular/common';
|
|
import {NgModule} from '@angular/core';
|
|
import {FormsModule} from '@angular/forms';
|
|
|
|
import {AppComponent} from './app.component';
|
|
import * as ExpressionCases from './expression-cases';
|
|
import * as NgForCases from './ng-for-cases';
|
|
import * as NgIfCases from './ng-if-cases';
|
|
import * as ParsingCases from './parsing-cases';
|
|
|
|
@NgModule({
|
|
imports: [CommonModule, FormsModule],
|
|
declarations: [
|
|
AppComponent,
|
|
ExpressionCases.ExpectNumericType,
|
|
ExpressionCases.LowercasePipe,
|
|
ExpressionCases.PrivateReference,
|
|
ExpressionCases.WrongFieldReference,
|
|
ExpressionCases.WrongSubFieldReference,
|
|
NgForCases.UnknownEven,
|
|
NgForCases.UnknownPeople,
|
|
NgForCases.UnknownTrackBy,
|
|
NgIfCases.ShowIf,
|
|
ParsingCases.AsyncForUsingComponent,
|
|
ParsingCases.AttributeBinding,
|
|
ParsingCases.CaseIncompleteOpen,
|
|
ParsingCases.CaseMissingClosing,
|
|
ParsingCases.CaseUnknown,
|
|
ParsingCases.EmptyInterpolation,
|
|
ParsingCases.EventBinding,
|
|
ParsingCases.NoValueAttribute,
|
|
ParsingCases.NumberModel,
|
|
ParsingCases.Pipes,
|
|
ParsingCases.PropertyBinding,
|
|
ParsingCases.References,
|
|
ParsingCases.StringModel,
|
|
ParsingCases.TemplateReference,
|
|
ParsingCases.TestComponent,
|
|
ParsingCases.TwoWayBinding,
|
|
]
|
|
})
|
|
export class AppModule {
|
|
}
|
|
|
|
declare function bootstrap(v: any): void;
|
|
|
|
bootstrap(AppComponent);
|