totaljs / framework

Node.js framework
http://www.totaljs.com
Other
4.36k stars 450 forks source link

How we can work with angularjs template and angular in totaljs? #565

Closed mahdi-gh33 closed 7 years ago

mahdi-gh33 commented 7 years ago

Hi @petersirka I have a angular template in public folder which it has its controllers , services , .... I see angular examples in totaljs . all of them are in app folder which they have their controller, templates , ... If I understand well from angularjs-nedb-rest-resources example after define our routes in controller, we should create app folder and define app module inapp.js, after that we should define factory in app/resources for our model Which is in line with the routes we have defined in controller and finally in app/controllers we use that factory to define our functions. But ng-app='app' and ng-controller='userCtrl' are define in views/app.html & layout.html but I don't use views in my project an I want to use them in my angular template . What i should i do now? I do not know if I could get it or not? But I want to use my routes as a service in my template.

Thank you.

mahdi-gh33 commented 7 years ago

I found the solution , I should add appmodule as a dependency of my template angular module and after that inject my factory anywhere that i need it.