Comments (3)
@daweedm the .bind()
workaround for sure works but it's inefficient as this call will be performed every time your component's view is change-detected, so IoEventContextToken
is meant to optimally do this for you.
As a more performant workaround you can use arrow function for an event handler method on your component so it's already bound by default.
But it's a good catch, the IoEventContextToken
must be part of the public API.
I will create a fix for this soon.
from ng-dynamic-component.
@gund I found a workaround by using .bind(this)
directly in the template :
<ng-template
[ngComponentOutlet]="PointingScreenItemComponent"
[ndcDynamicInputs]="{item: item}"
[ndcDynamicOutputs]="{selected: onItemSelected.bind(this)}"
*ngFor="let item of items"></ng-template>
Since function context binding works in the template, isn't IoEventContextToken
redundant ?
from ng-dynamic-component.
🎉 This issue has been resolved in version 10.6.2 🎉
The release is available on:
Your semantic-release bot 📦🚀
from ng-dynamic-component.
Related Issues (20)
- Question about dynamic templates HOT 2
- Support RxJS ^7.4.0 HOT 2
- Support for Angular 14 HOT 7
- Need add rxjs 7 support for version 9.x.x HOT 14
- Building app with angular 13 leads to compile error HOT 6
- Outputs initialized after inputs which leads to missed events triggered synchronously from constructors/setters HOT 2
- Cannot access 'IoService' before initialization HOT 8
- Backwards compatibility with Angular 13 in minor update v10.x.x is broken HOT 1
- [Question] How to call functions mentioned in dynamic components HOT 2
- Support for Angular 15 HOT 4
- Ability to provide ngModuleRef when creating component HOT 4
- Unknown input error after updating from no-barrels version [Bug] HOT 1
- Property 'withComponents' does not exist on type 'typeof DynamicModule'. HOT 1
- Support angular 14 HOT 1
- Component not support nested HOT 2
- [Bug] HOT 2
- Support for Angular 16 HOT 3
- Angular 17 support HOT 4
- [Bug] Remove ndc-dynamic from the dom using flex gap or add display none HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ng-dynamic-component.