What is substitution for CONFIG method in total.js V4?
Hi, I am trying to make a migration from total.js V3 to V4, we usually used in our definitions the method CONFIG (https://wiki.totaljs.com/jcomponent/03-globals#method-config-). So would like to know if theres another ways to do this in total.js V4
@LandyCuadra the link is targeted to jComponent - client-side UI library.
- wiki.totaljs.com contains old documentation for our other products and libraries
- new documentation: https://docs.totaljs.com/components/40d02001ra51c/#4e3ae001ta51c
In Total.js framework - use CONF.key instead of CONFIG() method. CONF is working in Total.js v3 too.
- Documentation:
CONF
ooh thanks peter, just a last doubt, in the first link it leads to V4 conf and config exist there as function, so why it didn't worked?, are the ui component in a different library?
CONF will work only in Total.js framework - in the view engine and once in the static files (.html, .js, .css) - because static files are compiled and cached. jComponent is a client-side UI library, and you don't need to use it with the Total.js framework (but we use the library in each Total.js product, and we offer more than 250 UI components for free).
UI components use config argument:
COMPONENT('mycomponent', function(self, config) {
// @self {Component} component instance
// @config {Object} with parsed configuration
});
- How to declare a configuration for the specific component? Read documentation and open Configuration section
Explanation:
- Total.js framework - is Node.js server-side framework
- jComponent library - is the client-side library for creating reusable UI components and web apps
- Total.js Platform - is a collection of all our frameworks, libraries, products and components
Got it, thank you alot