SPA (single page application) Single page implementing method and system
An implementation method and single-page technology, applied in the Internet field, can solve problems such as unfriendly, ineffective browser back button failure, poor user experience, etc., and achieve the effect of reducing time waiting, improving page access efficiency, and eliminating stuttering.
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0035]本发明实施例提供一种SPA单页面实现方法,参见图2,具体实现步骤包括:
[0036]步骤一:引用核心文件并注入;
[0037]步骤二:定义路由信息表;
[0038]步骤三:定义重新加载范围。
[0039]本发明实施例通过基于AngularJS以及其核心路由插件引用核心文件并注入、定义路由信息表实现灵活配置前端路由,并且定义重新加载范围,实现了灵活定义需要重新加载的范围,降低了重复加载公共文件的时间,从而提高了页面访问效率;因为降低了页面切换的时间等待,所以带来了更加优秀的用户体验,消除了卡顿、页面空白等不友好体验。
Embodiment 2
[0041]本发明实施例提供一种SPA单页面实现方法,参见图2,具体实现步骤包括:
[0042]步骤一:引用核心文件并注入;
[0043]首先需要在页面引入angular和angular-route,要在angular-route之前引入angular。
[0044]
[0045]
[0046] Because angularjs is an MVC front-end framework, one of its core ideas is to mount on demand, so it is not enough to introduce it on the page. It is also necessary to inject a dependency on ngRoute in the module declaration. The specific reference code:
[0047] var app = angular.module('MyApp',['ngRoute']);
[0048] After importing files and modules, you can use routing services and instructions in templates or controllers.
[0049] Step 2: define routing information table;
[0050] In the design mode of angularjs, defining the routing information table can be equivalent to the initial application of the program. The program will render the page according to the content of the routing information table, and at the same time load the page according to the address of the browser or the routing method.
[0051] The $routeProvide...
PUM
Abstract
Description
Claims
Application Information
- R&D Engineer
- R&D Manager
- IP Professional
- Industry Leading Data Capabilities
- Powerful AI technology
- Patent DNA Extraction
Browse by: Latest US Patents, China's latest patents, Technical Efficacy Thesaurus, Application Domain, Technology Topic, Popular Technical Reports.
© 2024 PatSnap. All rights reserved.Legal|Privacy policy|Modern Slavery Act Transparency Statement|Sitemap|About US| Contact US: help@patsnap.com