Welcome to Angular!{{name}}
下面是子组件的内容
5秒后再加载这个子组件
@defer(on timer(5000)){正在加载中...
}@loading (minimum 2s) {Loading comments...
}又可以叫做异步组件,异步组件就是组件在加载的时候不是一次性全部加载,而是当需要的时候再去加载。

需要异步加载的子组件
- Building for the web is fantastic!
- The new template syntax is great
- I agree with the other comments!
父组件中
Welcome to Angular!{{name}}
下面是子组件的内容
5秒后再加载这个子组件
@defer(on timer(5000)){ }@placeholder { 正在加载中...
}@loading (minimum 2s) { Loading comments...
} 这就实现了异步组件。
上一篇:爱写作怎么用-爱写作使用教程
下一篇:Spring