简体   繁体   English

在单个模板@ Foundation-Apps上有多个视图? (AngularJS)

[英]Multiple views on a single template @ Foundation-Apps? (AngularJS)

How can I load multiple views on a single template? 如何在单个模板上加载多个视图?

For example I have my main page splitted in 2 columns and I want to add a view on the left column and another, different view on the right column. 例如,我的主页分为两列,我想在左列添加一个视图,在右列添加另一个视图。

What code do I need to put in which files in order to acomplish this? 为了完成此操作,我需要在哪些文件中放入什么代码? I want to mention that I know how to add a single view per template. 我想提到的是,我知道如何为每个模板添加单个视图。 Be that as it may I'm still learning. 那样吧,我可能还在学习。

I've read this -- https://github.com/angular-ui/ui-router/wiki/Multiple-Named-Views -- but I can't seem to optimize that with Foundation. 我已经读过-https: //github.com/angular-ui/ui-router/wiki/Multiple-Named-Views-但我似乎无法使用Foundation对其进行优化。

As said by one of its creators here : 至于说通过它的创作者之一在这里

the dynamic routing in FA is meant to be used in the most basic sense and for rapid prototyping. FA中的动态路由应在最基本的意义上使用并用于快速原型制作。 More advanced features should be left to a more conventional routing built out the angular way. 应将更多的高级功能留给以斜角方式构建的更常规的路由。

So you won't be able to use .state.views within its default Front Router which was built to simplify the use of the framework for non angularJs developers. 因此,您将无法在其默认的Front Router中使用.state.views ,该默认路由器旨在简化非angularJs开发人员对框架的使用。 To achieve what you need I recommend disabling it and implement your own $stateProvider instance. 为了实现您需要的功能,我建议禁用它并实现自己的$stateProvider实例。

More details about how to do it may be found here : 有关如何执行此操作的更多详细信息,请参见:

Foundation for Apps : How to replace the default Dynamic Routing plugin? Apps for Foundation:如何替换默认的动态路由插件?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM