[Angular 2] Keynote: Lazy Routing -- NGCONF
So How to do lazy loading for router in Angular 2.
The nomarl way to write a router in Angular 2:

You have SimpleCmp and UserCmp as child components. You also import {SimpleCmp, UserCmp} from 'xxxxxx'.
It will not be lazy loaded. Because you already have the reference to the child component.
But it turn out to be very easy to enable the lazy loading:

Just add '' to SimpleCmp and UserCmp.
Then you need to follow the convention of how to name the folder.

The '+' symbol means those folders are lazy loaded. So Component is called UserCmp, the folder should be named as 'user-cmp'. OKOK, not tooo bad.


[Angular 2] Keynote: Lazy Routing -- NGCONF的更多相关文章
- Angular基础(七) HTTP & Routing
一.HTTP a)Angular提供了自己的HTTP库来调用外部API,为了能够在等待API响应的过程中继续与界面交互,采用异步HTTP请求的方式. b)Get请求,首先导入Http, Respo ...
- Angular记录(8)
文档资料 箭头函数--MDN:https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Functions/Arrow_fun ...
- [译]用AngularJS构建大型ASP.NET单页应用(一)
原文地址:http://www.codeproject.com/Articles/808213/Developing-a-Large-Scale-Application-with-a-Single 渣 ...
- angular2-aot-webpack 生产环境下编译angular2
这里讲讲,angular2在生产模式下用webpack2进行打包的方法: //使用rollup打包还是比较坑的,功能及插件上都不如webpack, 关键不支持代码分离,导致angular里的lazy ...
- AngularJS with MVC4 CRUD
CRUD using MVC Web API and AngularJS In this article I am going to demonstrate about how can we crea ...
- Angular45
Angular 4 Tutorial for Beginners: Learn Angular 4 from Scratch https://www.youtube.com/watch?v=k5E2A ...
- [Angular2 Router] Lazy Load Angular 2 Modules with the Router
Angular 2 lazy loading is a core feature of Angular 2. Lazy loading allows your application to start ...
- [AngularJS] Lazy loading Angular modules with ocLazyLoad
With the ocLazyLoad you can load AngularJS modules on demand. This is very handy for runtime loading ...
- 关于Angular.js Routing 的学习笔记(实现单页应用)
最近开始学习angular.js,发现angular.js确实很方便,也很强大.在看到 AngularJS Routing and Multiple Views 这一部分的时候,有点乱.现在通过记录一 ...
随机推荐
- 在 Sublime Text 3 中运行 PHP
参考http://segmentfault.com/blog/tony/1190000000395951 把php添加到环境变量 1.我的电脑->属性->高级系统设置->高级-> ...
- freeswitch 拨号时添加自定义变量
Using Channel Variables in Dialplan Condition Statements Channel variables can be used in conditions ...
- pyqt5 窗体布局
窗体布局 1使用qtdesigner新建一个对话框,然后拖放几个按钮和文本框,按钮使用水平布局,效果如下: 鼠标选中水平布局再选中文本框,进行垂直布局,如下: 垂直布局后的效果如下: 然后,如何让窗体 ...
- iOS: 布局可视化语法 Visual Format Syntax
可视化语法 Visual Format Syntax The following are examples of constraints you can specify using the visua ...
- Java简单购物车设计
还是存在一些问题(比如clear函数没效果.乱码,单独测试也没,确实找不到问题),路过的给解决下... 第一部分 会话控制 会话跟踪: 使用隐藏表单字段 URL重写,实际就是直 ...
- ios6,ios7,ios7.1下设置UISearchbar的背景色
ios系统升级到7.1后,原来在7.0下显示正常的UISearchbar现在又出现问题了.究其原因,是由于UISearchbar的subview又做修改了. float version = [[[ U ...
- 百度统计js被劫持用来DDOS Github
今天中午刷着全国最大的信息安全从业人员同性交友社区zone.wooyun.org的时候,忽然浏览器每隔2秒就不断的弹窗: malicious javascript detected on this d ...
- css学习笔记一
1.在css开头用* {margin:0;padding:0;}可以清除所有样式 2.在css中table,th,td {padding:0;}效果等同于cellpadding="0″. 3 ...
- centos 6.5安装esx sdk
1. RHEL 6.3 64 bit yum install e2fsprogs-devel libuuid-devel yum install glibc.i686 yum install perl ...
- solr异常--Expected mime type application/octet-stream but got text/html.
Exception in thread "main" org.apache.solr.client.solrj.impl.HttpSolrServer$RemoteSolrExce ...