New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
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

angular-less

Automagically render LESS <link>s in AngularJS.

  • 1.0.0
  • unpublished
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
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

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc