NPM package in Angular (13) service

Forum to discuss the new web client version of Servoy.

NPM package in Angular (13) service

Postby deyon730 » Tue Jul 12, 2022 4:40 pm

Is it possible to create a Servoy Package Project and use NPM packages ?
deyon730
 
Posts: 2
Joined: Tue Jul 12, 2022 3:33 pm

Re: NPM package in Angular (13) service

Postby jcompagner » Tue Jul 12, 2022 4:50 pm

For which client are you talking about here?
Is that NGClient (angularjs) or the Titanium NGClient (angular)

What kind of npm package are we talking about.
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8829
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: NPM package in Angular (13) service

Postby j.kuizenga » Wed Jul 13, 2022 10:15 am

We want to introduce a Webservice package in our 2022.3 version that consumes the NPM openapi package.
I have been able to write some code but my package is not showing up in plugins
There seems to be no comprehensive guide on building a NG2 package as the one page of documentation does not really help..
j.kuizenga
 
Posts: 14
Joined: Wed Jul 13, 2022 10:03 am

Re: NPM package in Angular (13) service

Postby deyon730 » Wed Jul 13, 2022 10:26 am

We are talking about the Titanium NGClient, the Angular (13) version. As my colleague stated the documentation for this leaves a lot to be desired.
deyon730
 
Posts: 2
Joined: Tue Jul 12, 2022 3:33 pm

Re: NPM package in Angular (13) service

Postby jcompagner » Wed Jul 13, 2022 11:19 am

we have a servoyworld component example that goes from a NG1:

https://github.com/Servoy/servoyworld_component

to an Titanium NGClient:

https://github.com/Servoy/servoyworld_c ... /tree/ting

but that is focused more on a component package (but many of the concepts are the same)

for a service i would say, learn/look by example:

https://github.com/Servoy/svyKeyListene ... eylistener

you still need something like the spec file:

https://github.com/Servoy/svyKeyListene ... tener.spec

and manifest:

https://github.com/Servoy/svyKeyListene ... FEST.MF#L7

but then service is just a service.ts class that is an Injectable()

https://github.com/Servoy/svyKeyListene ... service.ts

which is refenced in the ng2config section in the spec file:

https://github.com/Servoy/svyKeyListene ... er.spec#L9

where you say the service name and other stuff
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8829
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: NPM package in Angular (13) service

Postby j.kuizenga » Wed Jul 13, 2022 1:30 pm

I mimicked that implementation yesterday, but my service is not showing up in the plugins
j.kuizenga
 
Posts: 14
Joined: Wed Jul 13, 2022 10:03 am

Re: NPM package in Angular (13) service

Postby jcompagner » Wed Jul 13, 2022 1:50 pm

if i just do on the active project on the Servoy Packages node -> create services package project -> mytest
then when that is created i select "mytest" and then say -> create new service

i get the service there (its a default helloworld)

and i see it in the plugins and i can call it in scripting:

plugins.mytestMytest.helloworld("test")
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8829
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: NPM package in Angular (13) service

Postby j.kuizenga » Wed Jul 13, 2022 1:56 pm

It wouldve been nice that what you just showed would be in the documentation, thanks though! That seems to work for me too weird...
j.kuizenga
 
Posts: 14
Joined: Wed Jul 13, 2022 10:03 am


Return to Servoy NGClient

Who is online

Users browsing this forum: No registered users and 6 guests