Last Updated: February 25, 2016
·
944
· sebastialonso

Including is.js to Angular

== in JS is broken, we all know that. You'd be well served with is.js, a javascript checker library.

It's awesomely versatile and lightweight. Give it a try.
I use it all the time in my Angular projects.

First install is.js

bowe install is_js --save

and include the <script> tag.

Create a module and factory for isJs

angular.module('isJS',[])
.factory('is',function($window){
  return $window.is;
});

For your app, include the module

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

Then inject the factory where you want

app.controller('SomeController', ['is', function(is){
  is.empty({}); //true
}]);

1 Response
Add your response

You wanna say "bower install is_js --save" are'nt you ?

over 1 year ago ·