Giter Club home page Giter Club logo

Comments (5)

gund avatar gund commented on May 29, 2024

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.

mcanfield avatar mcanfield commented on May 29, 2024

@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.

gund avatar gund commented on May 29, 2024

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.

mcanfield avatar mcanfield commented on May 29, 2024

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.

gund avatar gund commented on May 29, 2024

No problem. I will consider adding an example to the docs =)
Cheers!

from ng-dynamic-component.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.