AngularJS PushState迭代到达

时间:2014-06-15 11:53:40

标签: javascript angularjs pushstate

我在最近几天开始编写angularjs应用程序。 AngularJS感觉像超级英雄,但后来我想使用带有角度的pushState,每一个都崩溃了。我无法解决该错误消息。谁可以帮助理解这个问题?

AngularJS代码:

londonApp.directive "entry", ["$rootScope",'entryModal', ($rootScope) ->
    restrict    : "E",
    replace     : true,
    templateUrl : "#{PARTIALS_URL}/entry/entry.html",
    scope :
        entryId : "=id"
        entry   : "=data"
    controller : ($scope, $rootScope, joinModal,entryModal) ->
        $scope.entryDetail = ($event) ->
            $event.preventDefault()

            if $rootScope.currentUser is false or typeof $rootScope.currentUser == "undefined"
                joinModal.activate()
            else
                window.history.pushState '', 'Tester', $($event.target).parent('a').prop('href')
                entryModal.activate()
            no
]

错误讯息:

Error: [$rootScope:infdig] 10 $digest() iterations reached. Aborting!
Watchers fired in the last 5 iterations: [["fn: $locationWatch; newVal: 448; oldVal:    447","entries; newVal: false; oldVal: undefined","fn: $watchCollectionWatch; newVal: 1;     oldVal: undefined","loadMore; newVal: false; oldVal: undefined"],["fn: $locationWatch; newVal:  449; oldVal: 448","entries; newVal: false; oldVal: undefined","fn: $watchCollectionWatch;  newVal: 1; oldVal: undefined","loadMore; newVal: false; oldVal: undefined"],["fn: $locationWatch; newVal: 450; oldVal: 449","entries; newVal: false; oldVal: undefined","fn:  $watchCollectionWatch; newVal: 1; oldVal: undefined","loadMore; newVal: false; oldVal:  undefined"],["fn: $locationWatch; newVal: 451; oldVal: 450","entries; newVal: false; oldVal:  undefined","fn: $watchCollectionWatch; newVal: 1; oldVal: undefined","loadMore; newVal: false;  oldVal: undefined"],["fn: $locationWatch; newVal: 452; oldVal: 451","entries; newVal: false;  oldVal: undefined","fn: $watchCollectionWatch; newVal: 1; oldVal: undefined","loadMore;  newVal: false; oldVal: undefined"]]
http://errors.angularjs.org/1.2.17/$rootScope/infdig?p0=10&p1=%5B%5B%22fn%3…2%2C%22loadMore%3B%20newVal%3A%20false%3B%20oldVal%3A%20undefined%22%5D%5D
at http://asset.london.dev/lib/angular/angular.js:78:12
at Scope.$digest (http://asset.london.dev/lib/angular/angular.js:12396:19)
at Scope.$apply (http://asset.london.dev/lib/angular/angular.js:12622:24)
at http://asset.london.dev/lib/angular/angular.js:14129:36
at completeOutstandingRequest (http://asset.london.dev/lib/angular/angular.js:4330:10)
at http://asset.london.dev/lib/angular/angular.js:4631:7 angular.js:9899
Uncaught object angular.js:78
Resource interpreted as Image but transferred with MIME type text/html: "http://london.dev/entry/%7B%7B%20$root.assetUrl%20%7D%7D/img/lp-avatar.jpg". angular.js:2295
Resource interpreted as Image but transferred with MIME type text/html: "http://london.dev/entry/%7B%7B%20entry.user.avatar.Small.image%20%7D%7D". angular.js:2295
Resource interpreted as Image but transferred with MIME type text/html: "http://london.dev/entry/%7B%7B%20entry.image.Feed.image%20%7D%7D". angular.js:2295
GET Request to /feed api.js:13

该消息重复50次以上。

感谢

0 个答案:

没有答案