angular / batarang

AngularJS WebInspector Extension for Chrome
MIT License
2.43k stars 338 forks source link

One-time binding fail due to Angular Batarang 0.8.6 #255

Closed doggy8088 closed 9 years ago

doggy8088 commented 9 years ago

When I enabled the Angular Batarang 0.8.6, the "One-time binding" feature will be disabled. I'm using AngularJS 1.4. You can reproduce this problem at this page. Please try to enter something in the first input field. ( default value is T-Shirt and there is a angular expression below the form fields )

SomeKittens commented 9 years ago

I was not able to reproduce. Are you sure you're on Batarang 0.8.6? (and not Batarang "Stable", which is not associated with the project at all?)

kkFelix commented 9 years ago

+1, definitely with Batarang 0.8.6

<p>{{::foo}}!</p>
<button ng-click="foo = 'bar'">click</button>

"foo" keeps it initial value on click if Batarang is disabled, which is the desired behavior. When activated, foo changes to "bar".

SomeKittens commented 9 years ago

Not just Angular 1.4, was able to repro with 1.3 here: http://output.jsbin.com/warariduci

erwinmombay commented 9 years ago

ill take this. problem exists in: https://github.com/angular/angular-hint/blob/master/src/modules/scopes.js#L85

we need to skip doing any perf watching if the interpolation functions expression is a one time binding. we previously did this with strings that where one time bindings (can be seen a couple of lines prior to line 85).

erwinmombay commented 9 years ago

@SomeKittens @btford i'll need to discuss the solution with you guys on thursday since it seems pretty hacky (again related to the fact we the decorate the original expressions) and it might not make sense to fix it since batarang doesn't expose the watch performance on the panels at the moment.

SomeKittens commented 9 years ago

Fixed in https://github.com/angular/angular-hint/commit/0b98cfacc62247b0ceed46c523385e588a55190d

preethi29 commented 8 years ago

Am able to reproduce this 0.10.5 batarang and angular 1.3.8

SomeKittens commented 8 years ago

@preethi29 Please include a Plunkr or JSBin with your reproduction.