簡體   English   中英

如何用ng-init定義重音數據?

[英]How to define a data with accent with ng-init?

我需要使用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/

嗨,你只是錯過了幾個括號

ng-init=" descriptions = {
        floraison: { 
            photos: [
                       {file:'1-PaniculeSansPollen',  description:'Panicule sans pollen'},
                       {file:'2-DebutEmissionPollenSurLeBrinPrincipal', description:'Début émission pollen sur le brin principal'}
                    ]
                   }
                }"

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM