When I started working through the AngularDart tutorial I thought thata logical pages and Angular "views" were in one-to-one correspondence. But in Chapter 6, views are treated as part of a the index.html page (which is used to generate "view recipe" and "edit recipe"): <!-- ... more page elements here ... --> <section id="details"> <ng-view></ng-view> </section>如果一个视图可以成为一个页面的一部分,那么一个页面可以包含多个视图吗?If a view can be part of a page, can a page contain multiple views?推荐答案首先,网页"是什么意思?Angular.dart 用于构建单页应用程序,所以从技术上讲,整个 Angular 应用程序是单个网页.First, what do you mean by a "web page"? Angular.dart is used to build Single-page applications, so technically the whole angular app is a single web page.我们可以将页面"的定义扩展为:用户执行操作后浏览器的稳定状态.这将使术语页面"对单页应用程序有意义.We can expand the definition of a "page" to: stable state of the browser after the user performed an action. That would make term "page" meaningful for single-page applications.使用页面的新定义:因为角度视图可以嵌套并由其他视图组成,所以它们与页面不同.页面可以是视图的集合.所以要查看的页面是一对多的.但是,对于大多数使用平面路由的相对简单的应用程序,这种关系通常是 1 对 1.Using the new definition of page: Because angular views can be nested and composed of other views they are not the same thing as a page. Page can be a collection of views. So page to view is 1-to-many. However, for most relatively simple applications that use flat routing that relationship is usually 1-to-1. 这篇关于AngularDart:“逻辑页面"和意见是一对一或一对多或什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 08-20 09:19