所以我有這樣的一個變量從Django的:如何在AngularJS中使用Django對象變量列表?
[<Topic object>, <Topic object>]
我把它傳遞給角使用ng-init
這樣的:
<div class="profile-navigation" ng-init="ProfileTopics={{ProfileTopics|safe}} ">
我的語法解析錯誤,而不是成功的。
angular.js:12520 Error: [$parse:syntax] http://errors.angularjs.org/1.4.8/ $parse/syntax?p0=%3C&p1=not%20a%20primary%20expression&p2=16&p3=ProfileTopics%3D%5B%3CTopic%3A%20Topic""bject%3E%2C%20%3CTopic%3A%20Topic%object%3E%5D&p4=%3CTopic%3A%20Topic%object%3E%2C%20%3CTopic%3A%20Topic%object%3E%5D at Error (native) at https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.8/angular.min.js:6:416 at Object.s.throwError (https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.8/angular.min.js:210:32) at Object.s.primary (https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.8/angular.min.js:207:6) at Object.s.unary (https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.8/angular.min.js:206:174) at Object.s.multiplicative (https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.8/angular.min.js:205:434) at Object.s.additive (https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.8/angular.min.js:205:261) at Object.s.relational (https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.8/angular.min.js:205:96) at Object.s.equality (https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.8/angular.min.js:204:425) at Object.s.logicalAND (https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.8/angular.min.js:204:278)
我做了什麼錯,直到我得到了很多downvotes的 –