Include third-party angular modules.

Forum to discuss the new web client version of Servoy.

Include third-party angular modules.

Postby jeremiahb » Thu Nov 26, 2015 7:44 am

How do I include another Angular module in my NGClient solution. I can put the files in Media, but they don't execute. How do I include / reference them like a normal angular app?

Also, how do I include a non-angular third-party javascript library like Underscore.js. Again, I put it in Media, but it isn't included in the solution.

Thanks.
jeremiahb
 
Posts: 6
Joined: Fri Nov 13, 2015 7:15 am

Re: Include third-party angular modules.

Postby paronne » Mon Nov 30, 2015 5:53 pm

Hi,

Why do you want to include a third party library ? are you creating a Servoy Web component around an angular directive from a third party library ?
In this case you would include the library from the .spec file of the web component itself. Place the libraries in the same folder of your custom web component (resouces/components/yourComponentPackage/yourComponent)
See in the wiki an example of the specification file: https://wiki.servoy.com/display/DOCS/Specification
The property 

Code: Select all
"libraries": [{"name":"accordionpanel", "version":"1", "url":"servoydefault/tabpanel/accordionpanel.css", "mimetype":"text/css"}] 

make sure that the css accordionpanel is loaded on the browser togheter with the custom web component.

If you would like to use the same library for a whole package of custom component you would like to declare load only once the library instead of doing for each component in package. In this scenario you can reference to the library from the manifest file.
An example of the such Manifest file in Servoy 8.0.1:

Code: Select all
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.8.4
Created-By: 1.7.0_05-b06 (Oracle Corporation)
CSS-ClientLibs: css/bootstrap/css/bootstrap.css;name=bootstrap;version=3.3.1
Absolute-Layout: True
Bundle-Name: Servoy Default
Bundle-SymbolicName: servoydefault

Name: button/button.spec
Web-Component: True
...
paronne
 
Posts: 202
Joined: Fri Nov 02, 2012 3:21 pm

Re: Include third-party angular modules.

Postby jcompagner » Tue Dec 01, 2015 12:49 pm

for underscore.js which is i think just a lib with all kind of usefull functions (not directly tied to a component)
you could make a service (instead of a component) that service can then have a 3th party lib (just as paolo described above)

then that lib will always be included, so you don't really need a component for that.
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet


Return to Servoy NGClient

Who is online

Users browsing this forum: No registered users and 4 guests

cron