jfhpoa
Last Updated: February 25, 2016
·
488
· sebastialonso
9b0f7bbf22d65fa2bd23496973c0ba80

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
}]);
Say Thanks
Respond

1 Response
Add your response

18434
0 2byeoysjfa bb7phm5azoomp5kvqv2 halezo0visvtbeel88tmqkxmdwozz9i12dkynazkk7ejk

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

over 1 year ago ·