framework icon indicating copy to clipboard operation
framework copied to clipboard

What is substitution for CONFIG method in total.js V4?

Open LandyCuadra opened this issue 5 years ago • 4 comments

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 avatar Aug 13 '21 20:08 LandyCuadra

@LandyCuadra the link is targeted to jComponent - client-side UI library.

In Total.js framework - use CONF.key instead of CONFIG() method. CONF is working in Total.js v3 too.

  • Documentation: CONF

petersirka avatar Aug 14 '21 07:08 petersirka

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?

LandyCuadra avatar Aug 16 '21 15:08 LandyCuadra

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

petersirka avatar Aug 16 '21 17:08 petersirka

Got it, thank you alot

LandyCuadra avatar Aug 17 '21 15:08 LandyCuadra