Simple page app routes to same view or controller SailsJS

后端 未结 3 544
不知归路
不知归路 2021-01-13 07:55

How can I route multiple urls to the same controller or view to work with angular single page app?!

I can do this but i think is ugly..

\'/\': {
            


        
3条回答
  •  既然无缘
    2021-01-13 08:35

    I don't know if your approach succeded but in my head mapping angular routes clientside to node routes serverside is misleading. My approach to an single page application with these two libraries would be:

    1. having the default sails view deliver your index and angular.js
    2. having the angular routes working your clientside routes together with controllers, etc
    3. managing the complete ui and page flow in angular
    4. using the default sails api's with angular ressource to work on the node models (dont forget to use promises)
    5. using the node / sails routes to add specials on top of that if needed (e.g. login management)
    6. using css framework to compile css (e.g. sass with compass or less)

提交回复
热议问题