dart-archive / angular.dart

Legacy source repository. See github.com/dart-lang/angular
https://webdev.dartlang.org/angular/
1.25k stars 248 forks source link

Only change dom attribue,the boolean attribute can't work well #1627

Open LinboLen opened 9 years ago

LinboLen commented 9 years ago
<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
</head>
<body ng-app mulit-select>
<h3>hello {{whole_selected}}</h3>
<input type="checkbox" ng-model="whole_selected" /><label>SelectALL</label>

<input type="checkbox" ng-checked="whole_selected" />
<input type="checkbox" ng-checked="whole_selected" />
<input type="checkbox" ng-checked="whole_selected" />
<input type="checkbox" ng-checked="whole_selected" />

<script type="application/dart" src="mulit_select.dart"></script>
<!-- jquery is used to test-->
<script type="application/javascript" src="http://code.jquery.com/jquery-1.11.1.js"></script>
<!--<script src="packages/browser/dart.js"></script>-->
</body>
</html>
import 'package:angular/angular.dart';
import 'package:angular/application_factory.dart';

@Injectable()
class MulitSelect {
  String whole_selected;
}

main(){
  applicationFactory()
  .rootContextType(MulitSelect)
  .run();
}
navigator.userAgent =
"Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 (Dart) Safari/537.36"

Problem

It does not work after I changed the sub input AngularDart change the Element Attribute work well,but the InputElement 's checked prototype not changed

Jquery can fix it

jquery has a method prop, $('input').prop('checked',true);

Angular.dart fix it by a ugly way

https://github.com/xsilen/angular.dart/compare/angular:master...patch-1?quick_pull=1

naomiblack commented 9 years ago

Could you submit your proposed fix as a PR please?

LinboLen commented 9 years ago

image Sure? I am afraid to pull request. I try to do it