简体   繁体   English

将oc lazyload与gulp-angle合并

[英]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 您需要做很多事情

  • Remove references of dependencies from index.html 从index.html删除依赖项引用
  • 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.

相关问题 无法安装gulp-angular - Cannot install gulp-angular 如何在gulp-Angular yeoman生成器中包含不是角度模块的依赖项? - How to include a dependency that is not an angular module in gulp-Angular yeoman generator? Yeoman gulp-angle给出错误Eacces权限被拒绝 - Yeoman gulp-angular give error Eacces Permission denied 在yeoman gulp-angular projekt设置之后的单元测试中出错 - Error in unit tests after yeoman gulp-angular projekt setup Bootstrap Nav Dropdown无法与Yeoman Gulp-Angular一起使用 - Bootstrap Nav Dropdown not working with Yeoman Gulp-Angular 用generator-ngdoc生成gulp-angular文档 - generating gulp-angular documentation with generator-ngdoc 一段时间前如何在装有gulp-angular的项目中添加Babel预处理器? - How to add the Babel preprocessor on a project scaffolded with gulp-angular some time ago? 使用回送REST API时如何更改gulp-angular项目的端口号 - How to change the port number of the gulp-angular project when using loopback REST API 我如何运行单元测试子集与Karma Gulp-Angular? - How Do I Run a Subset of Unit Tests Gulp-Angular with Karma? 无法与oc.lazyLoad延迟角度的负载控制器-找不到控制器 - Can't lazy load controllers in angular with oc.lazyLoad - controller not found
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM