paperbits-demo icon indicating copy to clipboard operation
paperbits-demo copied to clipboard

how angular is integrated with paperbits?

Open helxsz opened this issue 6 years ago • 7 comments

i see there is a little difference between angular and paperbits in the code, just wondering how the two is integrated together, any example and API to work with?

helxsz avatar Feb 02 '20 02:02 helxsz

Hi @helxsz, we're working on examples for Angular. Please use issue #60 for tracking.

azaslonov avatar Feb 02 '20 02:02 azaslonov

Has this been done?

TravisLRiffle avatar May 04 '20 22:05 TravisLRiffle

No, not yet. We don't see much people asking about it (currently we work with some people on their Vue and React components), so this doesn't get priority just yet.

azaslonov avatar May 04 '20 23:05 azaslonov

I have a very large company that will be using the APIM Dev Portal and they are mostly skilled in Angular. I am trying to come up with an example myself for this client.
I am trying to understand how to wire it up as I'm used to wiring up Angular apps from scratch. Would it be as simple as installing the NPM package and putting the <app-root> component in a widget to do Angular? I'm probably over simplifying it, but that kind of looks like what's going on in the Vue/React/Knockout example. They have custom development in the APIM dev portal that they will need to accomplish and are not familiar with KO. On the clickCounter example, how do I find this working in the webapp or is this even wired up?

TravisLRiffle avatar May 05 '20 04:05 TravisLRiffle

Right, for Angular it will look about the same as React and Vue, which live as standalone applications inside a widget container. They get wrapped into customElements, so the browser takes care of their instantiation once tag gets added to the DOM.

Basically, we're going to do similar thing described here: https://angular.io/guide/elements. So, if you're in a rush, please feel free to explore this direction. If it can wait, just give us a week or two to roll out examples and wiring tools.

azaslonov avatar May 05 '20 16:05 azaslonov

Thanks for the feedback - I'll take a look at this.
I think the only other thing I'm wondering about is how routing will work in Angular.

TravisLRiffle avatar May 05 '20 16:05 TravisLRiffle

In my understanding, there are three things that any router takes care of:

  • link generation;
  • navigation event handling;
  • reading current route information;

As long as every Angular-based widget injects the same Router (and its config), they should be able to exercise all three with no issue. I can answer better if you give me an example of widgets and their usage.

azaslonov avatar May 05 '20 16:05 azaslonov