angular-cli: YESTERDAY'S RELEASE : Lot of error when build AOT

After updating (existing project, on windows10) : CLI from rc2 to v1.0.0 Angular from rc4 to v4.0.0 Typescript to 2.2.1

Before yesterday’s release, I never get errors when building using --prod but today my projects doesn’t compile cause of private/protected members used in template!!! WHAT A MESS

https://gist.github.com/istiti/5b8e8c9db15135681f605b98e5a8e4f1

Wonder why this never happends before? how can I now search/replace all private/protected members used in template to public !

it’s maybe stupid enhancement but is it possible that cli convert all members to public when runnin ng build ? or add a command to overwrite these propertys to public directly in project?

N.B: relativly big project

cc @hansl @filipesilva @Brocco @IgorMinar

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 36
  • Comments: 18 (3 by maintainers)

Most upvoted comments

User opened issue without bothering to fill in issue template, no repro or anything!!! WHAT A MESS

@filipesilva please be nice. Your comment is in violation of our communication guidelines.

@istiti @Thieus @alastair-todd @bogdvn @hassanasad can one of you please open a new issue following the instructions in the issue template? We need all the info we can get to reproduce and confirm this issue before we can quickly fix it.

+1 could someone please explain this behaviour?

  1. for html templates to access their parent component’s properties, what accessor level should these properties be (private is the gut feeling, the html + component class make up the component, I shouldnt have to make them public)?
  2. why would the --prod flag change this behaviour?

Is there a way to solve this error with angular 2.4?

+1 Beside this errors:

[disabled]=“OnDsNotSelected()” error: Supplied parameters do not match any signature of call target.

OnDsNotSelected(): boolean { return this.options.length == 0; }

Why i get this ?

@oferns as i understand before they was taking about this error will appear only when building the aot or the prod. generally just keep your variables public if you are using them inside the html. you can serve your application with angular-cli as prod and aot “for testing and to help you with fixing the errors only” by running: ng serve --prod --aot.

If someone is looking to migrate a bigger codebase: I’ve created hacked together a small macOS script that patches your codebase to make the required fields and methods (those actually used in at least one template) public. Currently only tested (and probably only works) on macOS because of sed vs GNU-sed specifics.

https://gist.github.com/netmikey/cb29ac391953f2c67aa102b28fd4fe16

I am getting this error with @angular/cli v1.3.1 / Typescript 2.4.2 / @angular/core v4.3.5 ng build works. ng build --prod throws lots of errors like ERROR : Property ‘providers’ is private and only accessible within class ‘ProviderPickerComponent’.

Do we need to reopen this issue?