ocLazyLoad

{"id":"552d17dea86ee20d00780b89","name":"ocLazyLoad","subdomain":"oclazyload","versions":[{"version":"1.0","version_clean":"1.0.0","codename":"","is_stable":true,"is_beta":false,"is_hidden":false,"is_deprecated":false,"_id":"552d17dea86ee20d00780b8c","releaseDate":"2015-04-14T13:36:30.892Z"}],"current_version":{"version_clean":"1.0.0","version":"1.0"},"oauth":{"enabled":false},"api":{"name":"","url":"","contenttype":"form","auth":"","explorer":true,"proxyEnabled":true,"jwt":false,"headers":[],"authextra":[],"object_definitions":[]},"apiAlt":[],"plan_details":{"name":"Developer Hub","is_active":true,"cost":59,"versions":10000,"custom_domain":true,"custom_pages":true,"whitelabel":false,"errors":false,"password":true,"landing_page":true,"stylesheet":true,"javascript":false,"html":true,"extra_html":false,"admins":true},"intercom":"","intercom_secure_emailonly":false,"flags":{"allow_hub2":false,"hub2":false,"migrationRun":false,"oauth":false,"swagger":false,"correctnewlines":false,"speedyRender":false,"allowXFrame":false,"jwt":false,"hideGoogleAnalytics":false,"stripe":false,"disableDiscuss":false,"ssl":false,"autoSslGeneration":true,"cacheEnabled":true,"newApiExplorer":false,"newSearch":true,"useReactApp":false,"allowApiExplorerJsonEditor":false,"alwaysShowDocPublishStatus":false,"dashReact":false,"directGoogleToStableVersion":false,"disableAnonForum":false,"enterprise":false,"graphql":false,"internalSamlFlow":false,"metricsV2":true,"migrationSwaggerRun":false,"newEditor":false,"newMarkdownBetaProgram":true,"oldMarkdown":false,"rdmdCompatibilityMode":false,"singleProjectEnterprise":false,"staging":false,"translation":false},"asset_base_url":""}
  • Documentation
  • Support
    PopularNewestOpen

    General


    Empty Dependency module with dinamic loaded services and factories

    HI. I have some application that is module based and I have sahred module that includes the functionality not only for one module. So it is very big module and I don't want to give it's all functionality to client I want to lazy load it's functionality But after bootstraping main app The other modules I think remember shared module as empty and don't see it's services. Can some one help me? Am I doing something wrong??

    Posted in  General  by  Artur Gevorgyan
    Thu Mar 23 2017 06:46:04 GMT+0000 (Coordinated Universal Time)
    1,176 views
    1 comments
    How to config the loaded module provider settings?

    Good morning Sir, We are lazy loading the ChartJS library to our application. But after it loaded we would need to configure the ChartJsProvider settings. like below in config method of the angularjs. (function (ChartJsProvider) { ChartJsProvider.setOptions({ colors : [ '#803690', '#00ADF9', '#DCDCDC', '#46BFBD', '#FDB45C', '#949FB1', '#4D5360'] }); }); Could you please help us to how to configure the ChartJSProvider settings using ocLazyLoad.load module? Thank you, Srinivas P N V.

    Posted in  General  by  P N V Srinivas
    Tue Jan 03 2017 09:58:21 GMT+0000 (Coordinated Universal Time)
    1,155 views
    0 comments
    OCLazy load don't resolve all dependencies first before loading the controller.

    I am loading module lazily with ocLazyLoad. It is something like : angular.module('lazyModule', [ 'lazyModule.services', { files : [ 'path to services.js' ], cache : true }]); Inside service.js, I have other dependencies : angular.module('lazyModule.services', [ { files : [ 'path to some constants.js', 'path to some services.js', 'path to some model.js', 'path to some provider.js' ], cache : true } ]); In the route file I loaded the module as : .state('app', { templateUrl : 'some url', resolve : { loadModule : ['$ocLazyLoad', function ($ocLazyLoad) { return $ocLazyLoad.load(['airtel.postpaid']); }] } }) Module is loaded properly, but my view is loaded before the service.js dependencies(constants, models, providers etc.). I want to load all the module dependencies first and then the controller.

    Posted in  General  by  Bhaskar Pandey
    Wed Mar 30 2016 17:53:44 GMT+0000 (Coordinated Universal Time)
    1,134 views
    1 comments
    Unable to load the control part,the js file is loading

    Here is the code $ocLazyLoadProvider.config({ 'debug': true, // For debugging 'true/false' 'events': true, // For Event 'true/false' 'modules': [{ // Set modules initially name : 'start', // State1 module files: ['js/controller/StartPageController.js','css/slider.css','css/style.css','js/application.js','Assets/CSS/studio.css','js/controller/RegistrationController.js'] },{ name : 'home', // State2 module files: ['js/controller/HomeController.js','css/animate.css'] }, { name : 'studio', // State2 module files: ['js/controller/StudioController.js','Assets/CSS/CssStudio.css'] },{ name : 'gallery', // State2 module files: ['js/controller/GalleryController.js'] }, { name : 'login', // State2 module files: ['js/controller/LoginController.js'] }, { name : 'registration', // State2 module files: ['js/controller/RegistrationController.js'] } ] }); //Config/states of UI Router $stateProvider .state('start', { url: "/start", views : { "" : { templateUrl:"view/slider.html" } }, resolve: { loadMyCtrl: ['$ocLazyLoad', function($ocLazyLoad) { return $ocLazyLoad.load('start'); // Resolve promise and load before view }] } }) //controller.js .controller("LoginController", function ($scope, $state, $ionicModal, $rootScope, $ionicNavBarDelegate, $ionicSideMenuDelegate, DataStorageService, TranslateService, $ionicHistory, $ionicPopup, UserService, $AlertService, PortfolioService) { $ionicSideMenuDelegate.canDragContent(false); $scope.hideBackButton = true; $scope.passwordType = "password"; $scope.passwordFlag = true; $scope.user = {email: "", password: ""}; $scope.showPassword = function () { $scope.passwordFlag = !$scope.passwordFlag; if ($scope.passwordType === "password") { $scope.passwordType = "text"; } else { $scope.passwordType = "password"; } };

    Posted in  General  by  Akash Edakkalathur
    Fri Jan 27 2017 19:01:22 GMT+0000 (Coordinated Universal Time)
    1,127 views
    0 comments
    access to downloaded code as a text

    I have an idea to make i18n of JavaScript code on the fly. So I'd like to get source code of a file then to make substitution of words (phrases) and only after that to "make eval" of that code. Is it possible?

    Posted in  General  by  Alexander Levakov
    Sat Mar 04 2017 17:57:22 GMT+0000 (Coordinated Universal Time)
    1,088 views
    0 comments
    unable to load moules with grunt js

    I am facing the same issues with loading files with ocLazyLoad.js This is my config in routing , $ocLazyLoadProvider.config({ 'debug': true, // For debugging 'true/false' 'events': true, // For Event 'true/false' 'modules': [{ // Set modules initially name : 'reportModule', // State1 module files: ['src/app/reportModule/controllers/reportModule.js','src/app/reportModule/models/reportModuleService.js'] }] }); $stateProvider.state('reportModule', { url: '/reportmodule', views: { "main": { controller: 'ReportModuleController', templateUrl: 'reportModule/views/reportModule.tpl.html' } }, resolve: { loadMyCtrl: ['$ocLazyLoad', function($ocLazyLoad) { return $ocLazyLoad.load('reportModule'); // Resolve promise and load before view }] }, data: { pageTitle: 'Report' } }); Other than that i want to tell you that my projects loads all the modules with grunt's tasks So how does that affect ondemand loading .? Can you Please help me ? Regards.

    Posted in  General  by  Lad Rishiraj
    Wed Oct 19 2016 06:37:40 GMT+0000 (Coordinated Universal Time)
    1,085 views
    0 comments
    Redirect state to otherwise after refresh page

    Hello... I create an issue on stackoverflow please read it, https://stackoverflow.com/questions/48238918/redirect-state-to-otherwise-after-refresh-page Thanks ... pls help :'(

    Posted in  General  by  Maher Ashori
    Sat Jan 13 2018 10:55:52 GMT+0000 (Coordinated Universal Time)
    1,046 views
    0 comments
    Support for querystring in js file loading

    Hi, I am using a proxy service to get the js files from different domains which requires the url of the target js to be passed in a querystring. When I do this the scripts are not being added to the page. There is no error message and the DOM is unchanged. Is this expected? Tim

    Posted in  General  by  Tim Bowden
    Tue Jul 05 2016 08:34:35 GMT+0000 (Coordinated Universal Time)
    1,025 views
    1 comments
    Use custom loader

    I've written a custom loader, except the module injection of angular doesn't work yet, and the internet doesn't tell much about it. Now ocLazyLoad does work with module injection, awesome! +1, how can i use my own loader for the file, and then trigger ocLazyLoad to "inject" the result?

    Solved!
    Posted in  General  by  Samantha Adrichem
    Fri Feb 19 2016 08:22:03 GMT+0000 (Coordinated Universal Time)
    993 views
    2 comments
    Not loading the minified js when loading index in production

    I used below to load the one angular module in another using below <div oc-lazyload= [{type:'index.html'}]><myapp></myapp></div>

    Posted in  General  by  Bindupriya
    Wed Oct 26 2016 03:01:46 GMT+0000 (Coordinated Universal Time)
    986 views
    0 comments
    CacheBust with Oclazyload

    Hi team, I am using OcLazyLoad in my application and it is working pretty fine, i just want to know if there is a solution that allow to give a file a unique hash as Cachebust. Indeed, the cache attribute given is loading files each time we need a lazy loaded module. Thanks in advance. Squad

    Posted in  General  by  Squad
    Thu Jun 16 2016 13:53:23 GMT+0000 (Coordinated Universal Time)
    979 views
    0 comments
    Does not seem to work with Stripe

    The following code doesn't work: $ocLazyLoad.load('https://js.stripe.com/v2/').then(function () console.log('stripe loaded'); }); It doesn't load the script at that location and doesn't reach the console.log line. It seems something about the URL breaks the script loading. Any ideas? Thanks for the great library!

    Solved!
    Posted in  General  by  Yaron Guez
    Fri Apr 08 2016 23:13:10 GMT+0000 (Coordinated Universal Time)
    966 views
    4 comments
    How to create PRETTY URL on Oclazyload

    Posted in  General  by  Ngadiono CR
    Sat Jan 28 2017 00:05:00 GMT+0000 (Coordinated Universal Time)
    959 views
    0 comments
    lazy load

    i have a dashboard which users two controllers and these two controllers are in different file. can i know how to load two controllers using lazyload. below is the code which i have altered by does not work firsttime. when i open the page that uses the second controller and close then the dash board works fine. .state('dashboard.home',{ url:'/home', controller: 'MainCtrl', templateUrl:'views/dashboard/home.html', resolve: { loadMyFiles:function($ocLazyLoad) { return $ocLazyLoad.load({ name:'sbAdminApp', files:[ 'scripts/controllers/main.js', 'scripts/directives/timeline/timeline.js', 'scripts/directives/notifications/notifications.js', 'scripts/directives/chat/chat.js', 'scripts/directives/dashboard/stats/stats.js' ] }) $ocLazyLoad.load({ name:'sbAdminApp', files:['scripts/controllers/pvContoller.js'] }) } } })

    Posted in  General  by  shashikala g
    Thu May 05 2016 12:01:07 GMT+0000 (Coordinated Universal Time)
    955 views
    0 comments
    Can I use cache parameter with oc-lazy-load directive?

    Hi! Just wondering if it's possible to use cache parameter when using oc-lazy-load directive? I need to turn off caching. Something like this: <div oc-lazy-load="['widgets/widget/widgetModule.js']" oc-cache="false" ... "> Thanks in advance! -Kalle

    Posted in  General  by  Kalle
    Tue Jun 21 2016 12:51:58 GMT+0000 (Coordinated Universal Time)
    954 views
    2 comments
    How to reload fail load resource ???

    Somethings, I get error Fail load reload, maybe because networking. But, how can i run reload this resource ? How can I get status of this resource by OcLazyload ? Thanks guys.

    Posted in  General  by  Jay
    Mon Oct 03 2016 02:52:14 GMT+0000 (Coordinated Universal Time)
    912 views
    0 comments
    Wait loading 1st file for loadgin second file with a router ?

    Hello, I want load file whan i call my state like this [code] .state('myState', { url: "/myUrl", templateUrl: "views/myView.html", controller: "myController", resolve: { deps: ['$ocLazyLoad', function($ocLazyLoad) { return $ocLazyLoad.load({ name: 'myRoute', insertBefore: '#ng_load_plugins_before', files: [ 'provider/provider1.js', 'provider/provider2.js', 'provider/provider3.js', 'controler/mycontroller.js' ] // here todo Callback files for loader the second controller } //, Or here ? todo Callback files for loader the second controller ); }] } }) [/code]

    Posted in  General  by  W-prog
    Thu Feb 09 2017 10:48:36 GMT+0000 (Coordinated Universal Time)
    879 views
    0 comments
    How to lazy load module and service in ui router ?

    Solved!
    Posted in  General  by  Dnyanesh Golhar
    Wed May 11 2016 09:39:36 GMT+0000 (Coordinated Universal Time)
    876 views
    4 comments
    Configurable OCLazyLoad

    Hi team, I am using OcLazyLoader in my application and it is working pretty fine, i just want to know if there is any way i can make OCLAzyLoader configurable. By configurable i mean i can use it as a Switch, when i want i can use it and when i don't want i can turn it off. So is there any method or any event with which i can achieve this. Thanks in advance.

    Solved!
    Posted in  General  by  Aditya Tandon
    Wed Jun 08 2016 06:02:42 GMT+0000 (Coordinated Universal Time)
    818 views
    3 comments
    How to resolve multi function in UI-Router with ocLazyLoad

    Hi I want to resolve multi function and pass to controller with ocLazyLoad. .state('admin.editUser',{ url: "/users/:id/edit", templateUrl: "app/modules/user/views/userform.html", ncyBreadcrumb: { label: 'New User', parent:'admin.users' }, data: { permits: { withOnly: 'edit_user' } }, controller:'UserEditCtrl', resolve: { dep: ['$ocLazyLoad', function( $ocLazyLoad ){ return $ocLazyLoad.load(['dropzone','RoleServiceModule','UserServiceModule']).then( function(){ return $ocLazyLoad.load(['app/modules/user/controllers/UserEditCtrl.js']); } ); }], resolvedItems:['dep','UserService','$stateParams', function(dep,UserService,$stateParams) { return { user:function() { return UserService.show($stateParams.id).then(function(data) { return data; }); }, roomNo:function(data) { return "100"; } }; }] } })

    Posted in  General  by  essivision
    Mon Apr 11 2016 13:25:15 GMT+0000 (Coordinated Universal Time)
    812 views
    0 comments
    • 1
    • 2
    • 3
    • 4
    Ask a Question

    Categories

    • All Categories
    • General
    readme.io
    Fork me on GitHub