采用了棱角分明的js应用设计 [英] App design using Angular js

查看:107
本文介绍了采用了棱角分明的js应用设计的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一直在努力构建采用了棱角分明的js一个巨大的应用程序。看到的我们如何最好地设计一个应用程序,但就同一主题太多的问题仍然上午律相混淆。

Been working on building a huge app using angular js. Have seen too many questions on the same topic on how best we can design an app, but still am lil confused.

有一个基本的应用程序通常有一个

A basic app usually has a

1)登录页/索引页

2)首页 - 与页眉和页脚。身体是部分/复合材料,不断变化的。

2) Home page - with headers and footers. Body being the partial/composite which keeps on changing.

因为我们没有手柄,加载多个NG-意见,这是构建我们与页眉和页脚和正文通过$路由动态加载一个单一的网站首页容器主页这样的方式最好方式。

since we dont have handle to load multiple ng-views, which is best way to structure the Home page such a way that we have one single HomePage container with headers and footers and Body is loaded dynamically via $route.

现在,我一直在使用它通过$路由器加载登录页面和主页单一LoginContainerPage设计的,但由于只有一个NG-视图允许我不能在主页中使用另一个NG-视图动态LAOD身体再次。我不热衷于使用NG-包括为好。

Right now i have designed it using a single LoginContainerPage which loads Login page and home pages via $routers, but since only a single ng-view is allowed i cant use another ng-view within the Home page to laod the body dynamically again. i am not keen to use ng-include as well.

去另一种方式是保持LoginPage在$路径之外,并开始从主页使得车身动态加载路由。

Another way to go is keep LoginPage outside the $route and start routing from HomePage such that the Body is loaded dynamically.

要检查是否有各地的任何更好的想法。

Wanted to check if there are any better ideas around.

在此先感谢!

推荐答案

做好我的工作与angularjs项目我采取这种方式:
我有一个头,这是主要的导航系统,我为一个控制器处理的导航系统和知道我现在在哪里。我有一个基于路线,但有时我需要不同的模板,将其装入某些事件,例如AJAX加载标签编译基地,装我的主要内容的ngView。我实现这些类型的使用ngInclude该视图上的主控制器有责任选择模板,包括它的东西,我认为没有必要多ngViews你可以简单的使用范围,以实现不同的事物和处理的不同部分的应用具有不同的控制器和数据。我猜你是让你的登录页面独立的最好的主意。
我在我的项目这样做。我的登录页面是唯一的非Ajax网页,我有。

well in the project i'm working on with angularjs i took this approach: i had a header that was the main navigation system i made a controller for that that handled the navigation system and knew about where i am right now. i had an ngView which loaded my main content based on routes but sometimes i needed different templates to be loaded and compiled base on some event for instance ajax loaded tabs. i implemented these types of things using ngInclude that the main controller on the view had the responsibility to choose the template and include it, i believe there is no need for multiple ngViews you can simply use scopes to implement different things and handle different parts of your app with different controllers and data. i guess the best idea for you is to make your login page separate. i did this in my project. my login page was the only non-Ajax page that i had.

编辑:
对于authetication一部分,如果您希望通过角来实现验证您migh要检查这个

这篇关于采用了棱角分明的js应用设计的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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