🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

angular-less

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

angular-less

Automagically render LESS <link>s in AngularJS.

1.0.0
unpublished
latest
Source
npm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

ngLess

Automagically render LESS <link>s in AngularJS.

Installation

Download angular-less.js and add it to your HTML:

<script src="angular-less.js"></script>

You can also find it on Bower:

bower install angular-less

Usage

1- List it as a dependancy for your module:

var app = angular.module('myApp', ['ngLess']);

2- Add <link>s, just like you are supposed to:

<link rel="stylesheet/less" href="style.less">

ngLess will asynchronously issue a $http.get() for the file and insert a <style> in the <head> containing the less.render()d version of the file.

Caveats

  • When you include less.js in your project, it will automatically check for <link>s with rel="stylesheet/less" and convert them to CSS. You have to make sure that you add your <link>s after you load less.js. If you don't, the behaviour is undefined. (I always wanted to say "behaviour is undefined". It's such a cool way to say "I was too lazy to check what would happen.")

  • The <style> element created by ngLess is removed when $destroy on the <link> element is fired. If you add and remove <link>s in a way that AngularJS won't detect, you will end up polluting your <head> with unwanted <style>s.

  • ngLess attaches an angular.directive() to <head> to work. If you don't have a <head> (can you even not have a <head>?), ngLess will not work.

Keywords

angular

FAQs

Package last updated on 17 Mar 2015

Did you know?

Socket

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