Dynamically added attribute doesn't work in angularjs

I have a simple form with two input boxes of number type. When i try to add max attribute via directive, it seems to ignore it and doesn't validates although attribute is added on the dom element. When i add it inline it works.I referred this question AngularJs can't read dynamically set attributes but that did'nt seemed to help me.New in angularJS and completely clueless.

Any help appreciated.

Edit: Updated fiddle Demo http://jsfiddle.net/tNUNh/6/

Didn't look furthuer, but one solution you have is to recompile the element everytime you change its max value.

Just change inject $compile (module.directive('type', ['$compile', function ($compile) {) and after attr.$set('max', '100') call $compile(element)(scope).

This doesn't seem right, but I'd need to look further into input directive code to see if it exposes a way to change it without recompiling.