Static
templateThe folder where the templates are stored.
Only the templated from this folder will be preloaded loaded. If there are many template folders then those components will have to be loaded manually. or change the template folder and preload the templates again.
Ansh Sharma
Static
templateStatic
templatesThe preloaded templates (the default ones)
Static
loadLoad a template from the template folder
New atomizer template
The name of the template file
Static
preloadPreload All the templates from the template folder.
A dictionary of all the preloaded templates with their names as keys.
Static
buildStatic
addA static method in the Atomizer class that adds a new template folder to the templateFolders array.
If the templateFolder object's baseDir property does not already exist in Atomizer.templateFolders, the templateFolder object is pushed into Atomizer.templateFolders. Then, the templates in the newly added folder are preloaded and pushed into Atomizer.templates. If the baseDir already exists in Atomizer.templateFolders, a warning is logged.
Ansh Sharma
An object containing the base directory and optional subdirectories for the template folder.
The base directory for the template folder.
Optional subdirectory for HTML templates.
Optional subdirectory for CSS templates.
Optional subdirectory for JavaScript templates.
Static
getA static method in the Atomizer class that retrieves a template with the specified name and index from the templates property.
If the template is found in the templates property, it is returned immediately. If the template is not found, this method searches through all template folders for the specified name. If a template is found, it is returned and cached in the templates property for future use. If no template is found, an error message is logged and an empty string is returned.
Ansh Sharma
The name of the template to retrieve.
Optional
templateFolderIndex: 0The index of the folder containing the template. Defaults to 0.
Static
build
Atomizer
An utility class for loading/parsing and creating templates.
Remarks
This class is responsible for loading the templates from the template folder. It also provides a function to build the component tree from the HTML string.
Author
Sujal Choudhari <sjlchoudhari.gmail.com>