[英]Incorporating oc lazyload with gulp-angular
How can I incorporate oc lazyload to work with gulp-angular yeoman generator , Since running gulp will inject all the dependencies in the scripts folder. 我如何合并oc lazyload以与gulp- angle yeoman generator一起使用,因为运行gulp会将所有依赖项注入scripts文件夹中。 How can I configure oc lazyload to inject the dependencies instead ?
如何配置oc lazyload来注入依赖项?
There are multiple things you need to do 您需要做很多事情
Add dependencies for each project along with route using either 使用以下任一方法添加每个项目的依赖关系以及路线
<div oc-lazy-load="['scripts/controllers/about.js', 'scripts/services/helloservice.js']"> <div ng-controller="AboutCtrl as about"> Your html goes here </div> </div>
Or you can add references in app.js file 或者您可以在app.js文件中添加引用
$ocLazyLoadProvider.config({ modules: [{ name: 'helloWorldApp.contact', files: ['scripts/controllers/contact.js', 'scripts/services/contactservice.js'] }] });
I have implemented the same with Grunt instead of Gulp. 我已经用Grunt而不是Gulp实现了相同的功能。 But it's alomst same.
但这是一样的。 Checkout my article.
查看我的文章。 https://routerabbit.com/blog/convert-angularjs-yeoman-spa-lazyload/
https://routerabbit.com/blog/convert-angularjs-yeoman-spa-lazyload/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.