-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
AOT compilation fails due to private properties #352
Comments
Is there a good tool to help do this? @ocombe - u know of anything? |
A tool to help do what ? He's right, properties used in the template have to be public for AoT |
A tool to do ensure on build AoT is working right. |
I don't, but there is probably one, if you find out let me know. |
So apparently the best way to do it is to build the files, then run the tests with the builded files. |
Plz retry on latest :) |
[x] bug report
Current behavior
When using angular2-data-table with Just in Time (JiT) compilation it works great, however when trying to use Ahead of Time (AOT) compilation, it fails during compilation.
Root cause:
The data-tables components use private properties, however these properties may be accessed from the template. The properties need to be public.
(from https://medium.com/@isaacplmann/making-your-angular-2-library-statically-analyzable-for-aot-e1c6f3ebedd5):
3. private, protected accessors should be changed to public for any members accessed from template
Error:
Error: Error at /path/to/some.component.ngfactory.ts:134:40: Property 'context' is private and only accessible within class 'SomeComponent'.
Before:
@component({
template:
<div> {{ context }} </div>
})
export class SomeComponent {
private context: any;
}
After:
@component({
template:
<div> {{ context }} </div>
})
export class SomeComponent {
public context: any;
}
Expected behavior
AOT should be supported
Reproduction of the problem
run 'ngc' on your project with a specific tsconfig.aot.json
What is the motivation / use case for changing the behavior?
Please tell us about your environment:
MacOS, ngc, rollup
Table version: 2.1.3
Angular version: 2.2.3
Browser: all
Language: TypeScript 2.0
The text was updated successfully, but these errors were encountered: