NG Component CSS

Forum to discuss the new web client version of Servoy.

NG Component CSS

Postby Gordon McLean » Mon Apr 25, 2016 10:28 pm

Hi

I am trying to get a Servoy component to recognise a css file within the component file structure. The spec file I am using has the following format

{
"displayName": "infobox",
"name": "infobox-infobox",
"definition": "infobox/infobox/infobox.js",
"libraries": [
{
"name": "infobox.css",
"version": "v1.0.0",
"url": "infobox/infobox/infobox.css",
"mimetype": "text/css"
}
],
"model": {
"yourName": {"default": "World","type": "string"},
"styleClass": { "type": "styleclass", "default": "test",
"values": [
"test"
]},
"toolTipText": "tag string",
"size": { "type": "dimension", "default": {"width": 250, "height": 30 }}
},


"version": 1
}

This is basically ignoring the css within infobox.css the class definition is

.test {
background-color:red;
}

Any ideas would be more than welcome

best
Gordon
Gordon McLean
Clickdigital.com
Gordon McLean
 
Posts: 253
Joined: Wed Aug 03, 2005 12:24 pm
Location: UK

Re: NG Component CSS

Postby Gordon McLean » Tue Apr 26, 2016 11:15 am

The answer to this was ....

<button
ng-class='model.styleClass'
svy-click="handlers.onActionMethodID($event)">
</button>

which attaches the styleClass and the onAction function to the display level of the component. See the other possible items in the Angular Materials examples - which incidentally are a great help and should have been shipped day one Servoy !! :)

Best
Gordon
Gordon McLean
Clickdigital.com
Gordon McLean
 
Posts: 253
Joined: Wed Aug 03, 2005 12:24 pm
Location: UK

Re: NG Component CSS

Postby jcompagner » Mon May 02, 2016 10:25 am

For showing how component work we do ship components (but those are packaged in the installer/developer)
but the source of that is:

https://github.com/Servoy/servoy-client ... voydefault

Those are for our legacy, that do a lot to be complaint to the default set of components
a more simple or clean component set is:

https://github.com/Servoy/servoy-client ... components

(but ofcourse looking at the material stuff is also a very good option)

As an example how services (plugins) work:

https://github.com/Servoy/servoy-client ... es/dialogs
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8829
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 3 guests

cron