Tutorial by Examples

After including oclazyload.js in your index file, declare ocLazyLoad as a dependency in app.js //Make sure you put the correct dependency! it is spelled different than the service! angular.module('app', [ 'oc.lazyLoad', 'ui-router' ])
In order to lazily load files inject the $ocLazyLoad service into a controller or another service .controller('someCtrl', function($ocLazyLoad) { $ocLazyLoad.load('path/to/file.js').then(...); }); Angular modules will be automatically loaded into angular. Other variation: $ocLazyLoad.load([...
UI-Router: .state('profile', { url: '/profile', controller: 'profileCtrl as vm' resolve: { module: function($ocLazyLoad) { return $ocLazyLoad.load([ 'path/to/profile/module.js', 'path/to/profile/style.css' ]); } } }); ngRoute: .when('/profile', { controlle...
The following syntax allows you to specify dependencies in your module.js instead of explicit specification when using the service //lazy_module.js angular.module('lazy', [ 'alreadyLoadedDependency1', 'alreadyLoadedDependency2', ... [ 'path/to/lazily/loaded/dependency.js', 'path/to/l...
<div oc-lazy-load="['path/to/lazy/loaded/directive.js', 'path/to/lazy/loaded/directive.html']"> <!-- myDirective available here --> <my-directive></my-directive> </div>
What is Minification ? It is the process of removing all unnecessary characters from source code without changing its functionality. Normal Syntax If we use normal angular syntax for writing a controller then after minifiying our files it going to break our functionality. Controller (Before mini...
When the range_lookup parameter is either omitted, TRUE, or 1, VLOOKUP will find an approximate match. By "approximate", we mean that VLOOKUP will match on the smallest value that's larger than your lookup_value. Note that your table_array must be sorted in ascending order by lookup values...
Let's assume we have the following struct that defines a City type: type City struct { Name string Temperature int } We can encode/decode City values using the encoding/json package. First of all, we need to use the Go metadata to tell the encoder the correspondence between the...
You need to import System.ComponentModel for using background worker Imports System.ComponentModel Then Declare a private variable Private bgWorker As New BackgroundWorker You need to create two methods for background worker's DoWork and RunWorkerCompleted events and assign them. Private Su...
A common mistake is to declare a slice and start requesting indexes from it without initializing it, which leads to an "index out of range" panic. The following code explains how to recover from the panic without exiting the program, which is the normal behavior for a panic. In most situat...
In order for your public-private keypair to be of use, you must make your public key freely available to others. Be sure that you are working with your public key here since you should never share your private key. You can export your public key with the following command: gpg —armor —export EMAI...
Firstly, you want to go to firebase dashboard and create a new project using the 'Create New Project' button. You want to create a new project by adding the name of your app for example I put mine as 'Cool app name' then choose your region and press 'Create Project' After creating pr...
You need to decide what your forest structure is going to look like before you install Active Directory for the first time. Are you to have just one domain in your forest, or are you going to have multiple domains in your forest? Active Directory can support multiple sites. Generally sites are spl...
To simulate paging using REST you can do the following: Use the $skip=n parameter to skip the first n entries according to the $orderby parameter Use the $top=n parameter to return the top n entries according to the $orderby and $skip parameters. var endpointUrl = "/_api/lists('g...
Very often it happens to deal with models which have something like a published field. Such kind of fields are almost always used when retrieving objects, so that you will find yourself to write something like: my_news = News.objects.filter(published=True) too many times. You can use custom mana...
<ul class="nav nav-pills"> <li role="presentation" class="active"><a href="#">Home</a></li> <li role="presentation"><a href="#">Profile</a></li> <li role="presentation&q...
<ul class="nav nav-pills nav-stacked"> <li role="presentation" class="active"><a href="#">Home</a></li> <li role="presentation"><a href="#">Profile</a></li> <li role="pr...
<ul class="nav nav-tabs nav-justified"> <li role="presentation" class="active"><a href="#">Home</a></li> <li role="presentation"><a href="#">Profile</a></li> <li role="p...
max-width is the breakpoint @media (max-width: 1200px) { .navbar-header { float: none; } .navbar-left,.navbar-right { float: none !important; } .navbar-toggle { display: block; } .navbar-collapse { border-top: 1px solid transpar...
jQuery('body').bind('click', function(e) { if(jQuery(e.target).closest('#navbar').length == 0) { // click happened outside of .navbar, so hide var opened = jQuery('.navbar-collapse').hasClass('collapse in'); if ( opened === true ) { jQuery('#navbar2 .navb...

Page 878 of 1336