Comments (5)
Hi! Good question. I just thought it is obvious =)
It's actually standard angular @Inputs/@outputs on the dynamic components.
This lib will make sure to bind them like the angular does and also trigger all relevant life cycle hooks.
So from dynamic component point of view you do not do anything special at all (no magic) =)
from ng-dynamic-component.
@gund thanks for the quick reply! So I now understand how the inputs
work, but am still at a loss for grasping how outputs
do? I'm used to those being event emitters, but the source code looks like it just subscribes to changes on something... I'm too unfamiliar with inner workings to grasp complete comprehension.
Could you modify this http://plnkr.co/edit/wdYufHejtiDCMZldyKjc to demonstrate [ndcDynamicOutputs]
interaction between parent/child? I think a concrete example will make things abundantly clear.
Also, thanks for making this library, it's helping solve a headache I was having 😃 !
from ng-dynamic-component.
Sure, I have made change to plunkr here: http://plnkr.co/edit/DA5yPFVLNBq50ton4gk9
Basically your @Outputs
are ordinary Event Emitters (Observables
) and the lib will internally subscribe to them and dispatch events to the functions you provided in [ndcDynamicOutputs]
.
from ng-dynamic-component.
Ah, great! The thought occurred to me late yesterday to assign actual EventEmitter
, but I never got around to trying it that way. Something similar to what I've done here put into the documentation might be helpful to others. In any case, very clear now. Thanks so much!
from ng-dynamic-component.
No problem. I will consider adding an example to the docs =)
Cheers!
from ng-dynamic-component.
Related Issues (20)
- Is this project abandoned? HOT 3
- 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
- [BUG] `IoEventContextToken` is not exported HOT 3
- 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
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.