Error when performing AOT build: Property 'escapeKeyboardEvent' is private
See original GitHub issueI’m submitting a … (check one with “x”)
[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, post on Stackoverflow or Gitter
Current behavior
When performing an AOT build, I get the following error.
ERROR in (1,1): : Directive NgxSmartModalComponent, Property 'escapeKeyboardEvent' is private and only accessible within class 'NgxSmartModalComponent'.
ClientApp\app\public\productdetails\productdetails.component.html(56,1): : Directive NgxSmartModalComponent, Property 'escapeKeyboardEvent' is private and only accessible within class 'NgxSmartModalComponent'.
Expected behavior
I was expecting to be able to do AOT build.
Reproduction of the problem
Content of component HTML template
<!-- ... -->
<ngx-smart-modal #classicModal identifier="classicModal">
<h1>Hey, I'm a simple modal!</h1>
<img class="modal-image" src="http://lorempicsum.com/futurama/627/200/3" alt="Lorem picsum">
<p>{{ "sampleText[0]" }}</p>
<button class="button -dark" (click)="classicModal.close()">Close</button>
</ngx-smart-modal>
Content of app module
// ...
imports: [
BrowserModule,
HttpClientModule,
FormsModule,
ReactiveFormsModule,
NgxSmartModalModule.forRoot(),
// ....
]
// ...
Please tell us about your environment:
-
Windows 10 Enterprise
-
Smart Modal version: 6.0.2
- Angular version: 5.2.10
-
Browser: N/A
-
Language: TypeScript 2.5.3
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Error when performing AOT build: Property ... - GitHub
ERROR in (1,1): : Directive NgxSmartModalComponent, Property 'escapeKeyboardEvent' is private and only accessible within class ...
Read more >Angular AOT build failing because of Private member
Accessing private members is an error and so you should fix it. Solution: Make the property public. Every other solution I can imagine...
Read more >AoT compiles even when templates are accessing private ...
I came across this situation where I have a component with private fields, which are accessed in my template, but still the build...
Read more >Angular: Writing AoT-friendly applications | by David - Medium
Now, when running ng build --prod again, another error shows up: Property '{xyz}' is private and only accessible within class '{component}'.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
In
ngx-smart-modal.component.ts#L183-L184
, I see the following:Question to consider …
@HostListener
annotation on a private method?Angular AOT does care & check whether fields / properties /methods are private, both when checking component html templates and on usage (i.e. by library consumers like myself 🗣 ).
Yep, you’re right @matthewdunsdon, I’ll fix that! 👌