mbenford / ngTagsInput

Tags input directive for AngularJS
http://mbenford.github.io/ngTagsInput
MIT License
1.64k stars 541 forks source link

Error: type property can't be changed #405

Closed naz closed 9 years ago

naz commented 9 years ago

The tagsinput component is being initialized inside of $scope.$apply and this error is being thrown Error: type property can't be changed in this block:

tagsInput.directive('tiBindAttrs', function() {
    return function(scope, element, attrs) {
        scope.$watch(attrs.tiBindAttrs, function(value) {
            angular.forEach(value, function(value, key) {
                attrs.$set(key, value);
            });
        }, true);
    };
});

to be exact it gets thrown at : attrs.$set(key, value);

The question is how could this be prevented and whether or not this is a bug?

mbenford commented 9 years ago

Are you using jQuery? What version?

naz commented 9 years ago

Hi we are at 1.8.3. Thanks for getting back so fast btw :+1:

mbenford commented 9 years ago

That version of jQuery doesn't allow changing the input type attribute. You should upgrade it to at least 1.9.x. More information on that issue here.

naz commented 9 years ago

Great. Will look into that. Thank you for your time and support.

On Fri, Mar 20, 2015 at 4:45 PM, Michael Benford notifications@github.com wrote:

That version of jQuery doesn't allow changing the input type attribute. You should upgrade it to at least 1.9.x. More information on that issue here http://bugs.jquery.com/ticket/13011.

— Reply to this email directly or view it on GitHub https://github.com/mbenford/ngTagsInput/issues/405#issuecomment-84052714 .