1

我需要使用 ng-init 定义一个本地模型。不幸的是,我的口音有误。任何想法?

<div ng-init="
    descriptions = {
        floraison: { 
            photos: [
                {file:'1-PaniculeSansPollen',                       description:'Panicule sans pollen'},
                {file:'2-DebutEmissionPollenSurLeBrinPrincipal',    description:'Début émission pollen sur le brin principal'},
                etc. (remaining part of the code has been removed for the question)

错误如下:

Error: [$parse:lexerr] Lexer Error: Unexpected next character  at columns 430-430 [é] in expression [descriptions = {
        floraison: { 
            photos: [
                {file:'1-PaniculeSansPollen',                       description:'Panicule sans pollen'},
                {file:'2-DebutEmissionPollenSurLeBrinPrincipal',    description:'Début émission pollen sur le brin principal'},

[编辑] 添加小提琴:http: //jsfiddle.net/stephanedeluca/bS6ZU/

4

1 回答 1

0

嗨,你只是错过了几个括号

ng-init=" descriptions = {
        floraison: { 
            photos: [
                       {file:'1-PaniculeSansPollen',  description:'Panicule sans pollen'},
                       {file:'2-DebutEmissionPollenSurLeBrinPrincipal', description:'Début émission pollen sur le brin principal'}
                    ]
                   }
                }"
于 2014-07-04T23:26:42.547 回答