Recently, I've been working on developing custom functions for my Angular application. Following the official guidelines, I have created an independent library.
My goal is to create chainable functions similar to this:
var obj = {
test : function(){
console.log('1');
return this;
},
test2 : function(){
console.log('2');
return this;
}
}
obj.test().test2();
I'm now wondering how to properly export and import a chainable method in Angular. Additionally, I am unsure about the correct file type to use for these custom functions. Should it be a service, model, or component?
Any advice and insights on this matter would be greatly appreciated. Thank you!