Giter Club home page Giter Club logo

angular-prefetching-templates-poc's Introduction

angular-prefetching-templates-poc

This is a simple proof of concept, exemplifying a way to perform pre fetching on demand of mapped states html templates.

How its works:

Created a mechanism that loads the template when the 'ui-sref' directive is present. Through the value assigned to ui-sref, the state's settings are retrieved and the html loading done, this can be seen in src/ui-sref.decorator.js

Some things that can be improved:

  • Does not load template when directive is disabled.
  • Multiple requests to load the same template at the same time. See load method in TemplateLoader service, one option would be to check if the template is already being loaded.
  • Only prefetching when the application is idle, thus ensuring that the main requisites are not impaired due to lack of resources.

Run:

To run, any http server can be used:

cd src && python -m SimpleHTTPServer

Open the browser debug and check the requests.

angular-prefetching-templates-poc's People

Contributors

fernandomoraes avatar

Stargazers

 avatar

Watchers

 avatar  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.