如何构建在角js和锂应用路由? [英] How to structure routing in an Angular js and Lithium app?

查看:183
本文介绍了如何构建在角js和锂应用路由?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我采用了棱角分明的前端和锂的后端规划出一个中度复杂的应用程序。我充满了在这一点上的问题,但对于这个职位,我想对模板的一些想法。锂和角必须处理整个视图层的能力,但我宁愿把它像一个单页的应用程序,因此角会处理这个问题。

So I am planning out an app of moderate complexity using Angular for the frontend and Lithium for the backend. I'm full of questions at this point, but for this post I would like some ideas on templating. Both lithium and Angular have the capacity to handle the entire view layer, but I'd rather treat it like a single page app, so Angular will handle this.

现在我将如何处理路线?将锂主要是哑巴超越指数目前的路线?如果API端点有一个特殊的URL方案从视图中的网址分开?

Now how would I handle routes? Would Lithium basically be dumb of the current routes beyond the index? Should API endpoints have a special url scheme separate from the view URLs?

这是我现在怎么想::

This is how I am thinking now::

theapp.com/dashboard/calendar/event/eventID ::一个视图通过角处理
&安培;
theapp.com/api/event/eventID ::一个API端点

theapp.com/dashboard/calendar/event/eventID :: for a view handled by Angular & theapp.com/api/event/eventID :: for an API endpoint

我很新的建设这个事情复杂,所以请原谅我,如果这是一个简单的问题。 :)

I'm quite new to building something this complex so please forgive me if this is a simple question. :)

我是完全没谱?

推荐答案

这presentation应该会有所帮助:的 http://li3-angular.lithium-framework.com/

This presentation should be helpful: http://li3-angular.lithium-framework.com/

什么你计划是要走的路:LI3揭露一个JSON API和角度处理您的路线和观点。你的URL方案应遵循REST原则。

What you're planning is the way to go: Li3 expose a json api, and Angular handles your routes and views. Your URL scheme should follow REST principles.

  • li3_resources will help you to build a RESTful api: https://github.com/nateabele/li3_resources
  • Angular UI router should help you with your routes: https://github.com/angular-ui/ui-router

这篇关于如何构建在角js和锂应用路由?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆