Discussions

Ask a Question

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"; } };

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.

How to lazy load file synchronously?

I have load several files with ocLazyLoad and it logs out that the second load before the first one and it cannot find the defined module. here are my lazy load code ```javascript resolve: { deps: ['$ocLazyLoad', function($ocLazyLoad) { return $ocLazyLoad.load({ name: 'PSS_AdminApp', insertBefore: '#ng_load_plugins_before', files: [ 'assets/global/scripts/datatable.js', 'assets/global/plugins/datatables/datatables.min.js', 'assets/global/plugins/datatables/plugins/bootstrap/datatables.bootstrap.js', ] }); }] } ```

Lazy loading not working with dynamically added html import

Hi, Based on user role , i am dynamically adding the <link > with rel="import" to import the directive , this directive uses ocLazyload attribute to load all the dependencies, the dependencies are not loaded. where as if i use html import directly in head tag its working(not dynamic loading). please suggest

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>

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.

how to load component with templateUrl?

could you give me demo ?

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.

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

IE is not sending session cookie on Windows 8.1 on load

Hi. I'm using ocLazyLoader in a project to load js files into a page. There is an authentication module in the Azure app service hosting the files that requires the ASP.Net_SessionId cookie to be sent. It is being sent in IE11 on Windows 10, but not in IE11 on Windows 8.1. Is this an issue that has been encountered/solved by anyone else? Thanks Tim