Git Product home page Git Product logo

fl.lazy's Introduction

fl.lazy

https://oclazyload.readme.io/ helper

with ui-router

angular.module('someApp', [
  'ui.router',
  'fl.lazy'
]).config(['$stateProvider', '$lazyLoadHelperProvider', function($stateProvider, $lazyLoadHelperProvider){
  var modules = {
    grid: [
      {name: 'ui.grid', files: ['lib/angular-ui-grid/ui-grid.js', 'lib/angular-ui-grid/ui-grid.css']},
      {name: 'ui.grid.infiniteScroll', files: 'lib/angular-ui-grid/ui-grid.js'},
      {name: 'ui.grid.pagination', files: 'lib/angular-ui-grid/ui-grid.js'},
      {name: 'ui.grid.edit', files: 'lib/angular-ui-grid/ui-grid.js'},
      {name: 'ui.grid.cellNav', files: 'lib/angular-ui-grid/ui-grid.js'},
      {name: 'ui.grid.autoResize', files: 'lib/angular-ui-grid/ui-grid.js'},
      {name: 'ui.grid.resizeColumns', files: 'lib/angular-ui-grid/ui-grid.js'},
      {name: 'ui.grid.selection', files: 'lib/angular-ui-grid/ui-grid.js'}
    ],
    infiniteScroll: {name: 'infinite-scroll', files: 'lib/ngInfiniteScroll/ng-infinite-scroll.js'}
  };

  $lazyLoadHelperProvider.setOptions({
    urlArg : new Date().getTime(),
    modules : modules,
    filePath: "/",
    resolve:{
      someResolve:["$timeout", function($timeout){
        console.log("wait some time");
        return $timeout(function(){
        }, 1000);
      }]
    }
  });

  $stateProvider
    .state('home', {
      url: '/home',
      templateUrl: 'views/home.tpl',
      controller: 'HomeController',
      lazyModules: ['controllers/HomeController.js', modules.infiniteScroll]
    })

    .state('login', {
      url: '/login',
      templateUrl: 'views/login.tpl',
      controller: 'LoginController',
      lazyModules: 'controllers/LoginController.js'
    })
}]);

with filter

    <md-dialog-content layout="column">
      <ng-include src="'views/form.tpl'|normalizeFileUrl"></ng-include>
    </md-dialog-content>

Test

install karma

npm install -g karma-cli karma-jasmine karma-chrome-launcher
bower install

test

karma start karma.conf.js

fl.lazy's People

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.