Angular Material日期选择器错误:$ rootScope:infdig Infinite $ digest循环

时间:2016-05-23 09:35:39

标签: javascript html angularjs angularjs-directive angular-material

Angular v1.5.5
Angular Material v1.08

HTML代码:

<md-dialog>
<md-dialog-content>
    <md-datepicker ng-model="datePicker.data" md-placeholder="Enter date"></md-datepicker>
</md-dialog-content>
</md-dialog>

JS代码:

 link: function (scope, element) {

                element.bind('click', function (ev) {
                    $mdDialog
                        .show({
                            controller: ctrl,
                            templateUrl: 'view.html',
                            parent: angular.element(document.body),
                            targetEvent: ev,
                            clickOutsideToClose: false
                        });
                });
            }

错误:$ rootScope:infdig Infinite $ digest循环

达到10 $ digest()次迭代。中止! 观察者在最后5次迭代中被解雇:[[{“msg”:“fn:function(c,e,f,g){f = d&amp;&amp; g?g [0]:a(c,e,f, g); return b(f,c,e)}“,”newVal“:19,”oldVal“:18}],[{”msg“:”fn:function(c,e,f,g){f = d&amp;&amp; g?g [0]:a(c,e,f,g); return b(f,c,e)}“,”newVal“:20,”oldVal“:19}],[ {“msg”:“fn:function(c,e,f,g){f = d&amp;&amp; g?g [0]:a(c,e,f,g); return b(f,c, e)}“,”newVal“:21,”oldVal“:20}],[{”msg“:”fn:function(c,e,f,g){f = d&amp;&amp; g?g [0 ]:a(c,e,f,g); return b(f,c,e)}“,”newVal“:22,”oldVal“:21}],[{”msg“:”fn:function( c,e,f,g){f = d&amp;&amp; g?g [0]:a(c,e,f,g); return b(f,c,e)}“,”newVal“:23 “OLDVAL”:22}]]

有人知道为什么会这样吗?

0 个答案:

没有答案