Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'use strict';
- /**
- * InstanceOf Static Class
- */
- angular.module('intv.services').service('InstanceOfService',
- ['$injector',
- function($injector) {
- function _instanceOf(Object, Class) {
- return Object instanceof Class;
- }
- return function instanceOf(Object, ClassName) {
- try {
- var Class = $injector.get(ClassName);
- if (Class) {
- return _instanceOf(Object, Class);
- }
- return null;
- } catch (e) {
- $log.error(e.message);
- return null;
- }
- };
- }
- ]
- );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement