In order to more accurately map from a node in the TCB to a template position, we need to provide more span information in the TCB. These changes are necessary for the Language Service to map from a TCB node back to a specific locations in the template for actions like "find references" and "refactor/rename". After the TS "find references" returns results, including those in the TCB, we need to map specifically to the matching key/value spans in the template rather than the entire source span. This also has the benefit of producing diagnostics which align more closely with what TypeScript produces. The following example shows TS code and the diagnostic produced by an invalid assignment to a property: ``` let a: {age: number} = {} as any; a.age = 'laksjdf'; ^^^^^ <-- Type 'string' is not assignable to type 'number'. ``` A corollary to this in a template file would be [age]="'someString'". The diagnostic we currently produce for this is: ``` Type 'number' is not assignable to type 'string'. 1 <app-hello [greeting]="1"></app-hello> ~~~~~~~~~~~~~~ ``` Notice that the underlined text includes the entire span. If we included the keySpan for the assignment to the property, this diagnostic underline would be more similar to the one produced by TypeScript; that is, it would only underline “greeting”. [design/discussion doc] (https://docs.google.com/document/d/1FtaHdVL805wKe4E6FxVTnVHl38lICoHIjS2nThtRJ6I/edit?usp=sharing) PR Close #39665
Angular - One framework. Mobile & desktop.
Angular is a development platform for building mobile and desktop web applications
using Typescript/JavaScript and other languages.
Contributing Guidelines
·
Submit an Issue
·
Blog
Documentation
Get started with Angular, learn the fundamentals and explore advanced topics on our documentation website.
Advanced
Development Setup
Prerequisites
- Install Node.js which includes Node Package Manager
Setting Up a Project
Install the Angular CLI globally:
npm install -g @angular/cli
Create workspace:
ng new [PROJECT NAME]
Run the application:
cd [PROJECT NAME]
ng serve
Quickstart
Ecosystem
Changelog
Learn about the latest improvements.
Upgrading
Check out our upgrade guide to find out the best way to upgrade your project.
Contributing
Contributing Guidelines
Read through our contributing guidelines to learn about our submission process, coding rules and more.
Want to Help?
Want to file a bug, contribute some code, or improve documentation? Excellent! Read up on our guidelines for contributing and then check out one of our issues in the hotlist: community-help.
Code of Conduct
Help us keep Angular open and inclusive. Please read and follow our Code of Conduct.
Community
Join the conversation and help the community.
Love Angular? Give our repo a star ⭐ ⬆️.