Socket
Socket
Sign inDemoInstall

angularise

Package Overview
Dependencies
0
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    angularise

Deferred compilation of Angular.js templates for applications that render HTML from asynchronous processes.


Version published
Weekly downloads
1
decreased by-85.71%
Maintainers
1
Install size
15.5 kB
Created
Weekly downloads
 

Readme

Source

Angularise

Travis   npm   License MIT

  • Heroku: http://angularise.herokuapp.com/
  • Bower: bower install angularise

Angularise is a simple module for compiling HTML templates outside of the Angular.js runloop – such as asynchronous AJAX requests – in the case of Angularise you don't even require the scope to compile the HTML.

Getting Started

By default Angularise uses the scope which the ng-app attribute is assigned to – the root scope – you may override this default functionality.

In order to work with the Angularise module you simply need to pass in your HTML to the global angularise() method:

var compiledHtml = angularise('<strong>My HTML</strong>');
targetNode.append(compiledHtml);

All of this is especially useful when you consider an example with loading the HTML via an AJAX call – naturally you should be using the Angular.js approach of templates, but in legacy systems this is not always possible:

$.ajax('inception.html', { complete: function onComplete(response) {

    // Compiled the response text and then append it to a node.
    targetNode.append(angularise(response.responseText));

}});

Scope Element

Instead of using the node with the ng-app attribute, pass in a valid HTML element as the second argument of the angularise() method:

angularise('<strong>My HTML</string>', document.querySelector('div'));

Keywords

FAQs

Last updated on 06 Jan 2015

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc