{"_id":"552d17e0a86ee20d00780b8f","version":{"_id":"552d17dea86ee20d00780b8c","project":"552d17dea86ee20d00780b89","__v":7,"createdAt":"2015-04-14T13:36:30.892Z","releaseDate":"2015-04-14T13:36:30.892Z","categories":["552d17dfa86ee20d00780b8d","552e7d7406a32a0d009c2f7b","552e88cf5d4baa0d007836b1","552e8936a702770d00d96e4d","552e895434565d0d007b4a8d","552e89f82594f70d001b2d0e","552f8a9d8f136c0d005031e9"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"user":"5519ab08eaa2ed2f002135a0","project":"552d17dea86ee20d00780b89","__v":16,"category":{"_id":"552d17dfa86ee20d00780b8d","project":"552d17dea86ee20d00780b89","__v":4,"pages":["552d17e0a86ee20d00780b8f","552e89dd06a32a0d009c2f94","552e89e82594f70d001b2d0c","552e8a692594f70d001b2d0f"],"version":"552d17dea86ee20d00780b8c","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-04-14T13:36:31.423Z","from_sync":false,"order":0,"slug":"documentation","title":"Documentation"},"updates":["5548de0aafc5ed0d00e145f9","5589e3c175eaf50d004e4a8d","56abc6ca4e8ba20d006a23d8","57102fc5c510130e00d0b9d1","579f27015f116a2b004449eb"],"next":{"pages":[],"description":""},"createdAt":"2015-04-14T13:36:32.151Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"auth":"required","params":[],"url":""},"isReference":false,"order":0,"body":"1. Download ocLazyLoad.js. It can be found in the 'dist' folder of the git repository. You can also install it with `bower install oclazyload` or `npm install oclazyload`.\n\n2. Add the module `oc.lazyLoad` to your application:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"var myApp = angular.module(\\\"MyApp\\\", [\\\"oc.lazyLoad\\\"]);\",\n      \"language\": \"javascript\",\n      \"name\": \"Add the module to your application\"\n    }\n  ]\n}\n[/block]\n3. Load on demand:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"myApp.controller(\\\"MyCtrl\\\", function($ocLazyLoad) {\\n\\t$ocLazyLoad.load('testModule.js');\\n});\",\n      \"language\": \"javascript\",\n      \"name\": \"Basic example to load a module\"\n    }\n  ]\n}\n[/block]\nWith $ocLazyLoad you can load angular modules, but if you want to load any component (controllers / services / filters / ...) without defining a new module it's entirely possible (just make sure that you define this component within an existing module).\n\nThere are multiple ways to use `$ocLazyLoad` to load your files, just choose the one that you prefer.\n\nAlso don't forget that if you want to get started and the docs are not enough, see the examples in the 'examples' folder!","excerpt":"I want to start like right now!","slug":"getting-started","type":"basic","title":"Quick start"}

Quick start

I want to start like right now!

1. Download ocLazyLoad.js. It can be found in the 'dist' folder of the git repository. You can also install it with `bower install oclazyload` or `npm install oclazyload`. 2. Add the module `oc.lazyLoad` to your application: [block:code] { "codes": [ { "code": "var myApp = angular.module(\"MyApp\", [\"oc.lazyLoad\"]);", "language": "javascript", "name": "Add the module to your application" } ] } [/block] 3. Load on demand: [block:code] { "codes": [ { "code": "myApp.controller(\"MyCtrl\", function($ocLazyLoad) {\n\t$ocLazyLoad.load('testModule.js');\n});", "language": "javascript", "name": "Basic example to load a module" } ] } [/block] With $ocLazyLoad you can load angular modules, but if you want to load any component (controllers / services / filters / ...) without defining a new module it's entirely possible (just make sure that you define this component within an existing module). There are multiple ways to use `$ocLazyLoad` to load your files, just choose the one that you prefer. Also don't forget that if you want to get started and the docs are not enough, see the examples in the 'examples' folder!