bindings/angular1/services/onsen.js
function(view, element) {
          var methods = {
            hasModifier: function(needle) {
              var tokens = ModifierUtil.split(element.attr('modifier'));
              needle = typeof needle === 'string' ? needle.trim() : '';

              return ModifierUtil.split(needle).some(function(needle) {
                return tokens.indexOf(needle) != -1;
              });
            },

            removeModifier: function(needle) {
              needle = typeof needle === 'string' ? needle.trim() : '';

              var modifier = ModifierUtil.split(element.attr('modifier')).filter(function(token) {
                return token !== needle;
              }).join(' ');

              element.attr('modifier', modifier);
            },

            addModifier: function(modifier) {
              element.attr('modifier', element.attr('modifier') + ' ' + modifier);
            },

            setModifier: function(modifier) {
              element.attr('modifier', modifier);
            },

            toggleModifier: function(modifier) {
              if (this.hasModifier(modifier)) {
                this.removeModifier(modifier);
              } else {
                this.addModifier(modifier);
              }
            }
          };

          for (var method in methods) {
            if (methods.hasOwnProperty(method)) {
              view[method] = methods[method];
            }
          }
        }
function(view, element) {
          var methods = {
            hasModifier: function(needle) {
              var tokens = ModifierUtil.split(element.attr('modifier'));
              needle = typeof needle === 'string' ? needle.trim() : '';

              return ModifierUtil.split(needle).some(function(needle) {
                return tokens.indexOf(needle) != -1;
              });
            },

            removeModifier: function(needle) {
              needle = typeof needle === 'string' ? needle.trim() : '';

              var modifier = ModifierUtil.split(element.attr('modifier')).filter(function(token) {
                return token !== needle;
              }).join(' ');

              element.attr('modifier', modifier);
            },

            addModifier: function(modifier) {
              element.attr('modifier', element.attr('modifier') + ' ' + modifier);
            },

            setModifier: function(modifier) {
              element.attr('modifier', modifier);
            },

            toggleModifier: function(modifier) {
              if (this.hasModifier(modifier)) {
                this.removeModifier(modifier);
              } else {
                this.addModifier(modifier);
              }
            }
          };

          for (var method in methods) {
            if (methods.hasOwnProperty(method)) {
              view[method] = methods[method];
            }
          }
        }
function ( view , element ) { var methods = { hasModifier : function ( needle ) { var tokens = ModifierUtil . split ( element . attr ( 'modifier' ) ) ; needle = typeof needle === 'string' ? needle . trim ( ) : '' ; return ModifierUtil . split ( needle ) . some ( function ( needle ) { return tokens . indexOf ( needle ) != - 1 ; } ) ; } , removeModifier : function ( needle ) { needle = typeof needle === 'string' ? needle . trim ( ) : '' ; var modifier = ModifierUtil . split ( element . attr ( 'modifier' ) ) . filter ( function ( token ) { return token !== needle ; } ) . join ( ' ' ) ; element . attr ( 'modifier' , modifier ) ; } , addModifier : function ( modifier ) { element . attr ( 'modifier' , element . attr ( 'modifier' ) + ' ' + modifier ) ; } , setModifier : function ( modifier ) { element . attr ( 'modifier' , modifier ) ; } , toggleModifier : function ( modifier ) { if ( this . hasModifier ( modifier ) ) { this . removeModifier ( modifier ) ; } else { this . addModifier ( modifier ) ; } } } ; for ( var method in methods ) { if ( methods . hasOwnProperty ( method ) ) { view [ method ] = methods [ method ] ; } } }
Add modifier methods to view object for custom elements.

@param {Object} view object
@param {jqLite} element
Add modifier methods to view object for custom elements .