Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document compiler flag fullTemplateTypeCheck (at least in Release Notes) #19681

Closed
alan-agius4 opened this issue Oct 12, 2017 · 13 comments
Closed
Labels
area: core Issues related to the framework runtime freq2: medium state: blocked

Comments

@alan-agius4
Copy link
Contributor

alan-agius4 commented Oct 12, 2017

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[X] Bug report  
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior

In my html view I am referring a variable that it doesn't exist, This won't be catched unless someone consumes my library.

I am using NGC bin directly to compile my TS to NGC.

@Component({
	template: `<div *ngIf="isDisabled === true"></div>`
})
export class MainComponent  {

}

in the ngfactory.ts I can see that there is an error, however this is not emitted on compilation

const currVal_0:any = (_co.isDisabled === true);

image

Expected behavior

When compiling with NGC it should throw an error while compiling

Minimal reproduction of the problem with instructions

https://github.com/alan-agius4/angular-ngc-template-error

What is the motivation / use case for changing the behavior?

It should throw an error

Environment


Angular version: 4.4.4

For Tooling issues:

  • Node version: 8.1.0
  • Platform: Windows

Others:

@tbosch tbosch changed the title Compiler CLI not emitting un-declared variables errors in html template Document compiler flag fullTemplateCodegen (at least in Release Notes) Oct 13, 2017
@tbosch tbosch added area: core Issues related to the framework runtime comp: docs labels Oct 13, 2017
@tbosch
Copy link
Contributor

tbosch commented Oct 13, 2017

We have a new compiler setting called fullTemplateTypeCheck (see https://github.com/angular/angular/blob/master/packages/compiler-cli/src/transformers/api.ts#L99) which will reveal this error.

This setting will become the default in Angular 6, and is highly recommended. We didn't turn in on in Angular 5 to not break existing users. I.e. the behavior you are seeing here is exactly what users saw in Angular 4.

This works as intended, but somehow we forgot to document this. Keeping the bug open to track that we need to document this.

@tbosch tbosch added this to PRs or issues with PRs in Compiler Oct 13, 2017
@tbosch
Copy link
Contributor

tbosch commented Oct 13, 2017

Oh, there is a bug with fullTemplateTypeCheck right now, which will be fixed via #19582.

@alan-agius4
Copy link
Contributor Author

alan-agius4 commented Oct 13, 2017

The flag is only available in Angular 5 and later, or its also available in V4?

@tbosch tbosch moved this from PRs or issues with PRs to Prio_col0 in Compiler Oct 13, 2017
@tbosch
Copy link
Contributor

tbosch commented Oct 13, 2017 via email

@chuckjaz chuckjaz changed the title Document compiler flag fullTemplateCodegen (at least in Release Notes) Document compiler flag fullTemplateTypeCheck (at least in Release Notes) Oct 16, 2017
@tbosch tbosch removed this from Prio_col0 in Compiler Oct 27, 2017
@tbosch
Copy link
Contributor

tbosch commented Oct 27, 2017

We should first rollout fullTemplateTypeCheck in G3 before we document it though (see #19792).

@chuckjaz
Copy link
Contributor

chuckjaz commented Feb 6, 2018

fullTemplateTypeCheck is not documented.

@chuckjaz chuckjaz closed this as completed Feb 6, 2018
@mgol
Copy link
Member

mgol commented Feb 8, 2018

Why was this closed?

@devoto13
Copy link
Contributor

devoto13 commented Feb 8, 2018

@mgol It was documented some time ago: https://angular.io/guide/aot-compiler#fulltemplatetypecheck

@mgol
Copy link
Member

mgol commented Feb 8, 2018

Hmm, OK. I wonder why @chuckjaz wrote it's not documented just before closing then.

@kondi
Copy link
Contributor

kondi commented Feb 8, 2018 via email

@chuckjaz
Copy link
Contributor

chuckjaz commented Feb 8, 2018

Sorry. Yes. It is now documented. Sorry for the typo.

@kimamula
Copy link

kimamula commented Jul 27, 2018

This setting will become the default in Angular 6

Has this already been done?
The doc still says that this option is false by default and will default to true in the future.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: core Issues related to the framework runtime freq2: medium state: blocked
Projects
None yet
Development

No branches or pull requests

8 participants