haml中适当的角度语法

时间:2015-06-03 08:15:24

标签: angularjs haml

我正在开发一个包含haml视图的Angular项目,并拥有以下代码。

%textarea.answer{ |
    placeholder: 'Please enter your answer', |
    onfocus: '{ this.placeholder = " " }', |
    ng: { |
        model: 'canvasCtrl.stepToShow.answer', |
    } |                                                                                                                                     
} |

我想添加像这样的模型选项:

%textarea.answer{ |
    placeholder: 'Please enter your answer', |
    onfocus: '{ this.placeholder = " " }', |
    ng: { |
        model: 'canvasCtrl.stepToShow.answer', |
        model-options: 'canvasCtrl.savingsOptions', |
    } |                                                                                                                                     
} |

我从haml获得以下语法错误:

语法错误,意外的tLABEL ... pToShow.answer',模型选项:' canvasCtrl.savingsOptions',... ... ^ projects / canvas / views / home.haml: 53:语法错误,意外',',期待tSTRING_DEND ... s:' canvasCtrl.savingsOptions',})}> \ n \ n \ n \ n

\ n在这个页面上,你将...... ... ^ projects / canvas / views / home.haml:65:语法错误,意外的keyword_in,期待tSTRING_DEND ...项目。首先填写你的项目名称和描述...... ... ^ projects / canvas / views / home.haml:65:语法错误,意外的keyword_then ... t名称和描述然后点击第一个问题... .... ^ projects / canvas / views / home.haml:65:语法错误,意外$ undefined,期待'(' ... n点击第一个问题。\ n

< / p> \ n Hap ...... ... ^ projects / canvas / views / home.haml:65:语法错误,意外&#39;&lt;&#39; ... e第一个问题。\ n

\ n快乐计划....... ^ projects / canvas / views / home.haml:65:未知的regexp选项--p projects / canvas / views / home.haml:65:语法错误,意外$ undefined ... ppy规划。\ n

\ n你的画布Te ... ... ^ projects / canvas / views / home.haml:65:语法错误,意外tCONSTANT,期待keyword_do或&#39; {&#39;或&#39;(&#39; ... n你的画布团队\ n \ n \ n ...... ... ^ projects / canvas / views / home.haml:65 :未知的regexp选项 - dv projects / canvas / views / home.haml:65:语法错误,意外$ undefined ...团队\ n \ n \ n \ n \ n&#34;,-4,f ...... ... ^ projects / canvas / views / home.haml:65:未知的regexp选项 - htl projects / canvas / views / home.haml:65:语法错误,意外$ undefined ... \ n \ n \ n&#34;,-4,false); ... ^ projects / canvas / views / home.haml:65:未终止的字符串符合文件结束项目/ canvas / views / home.haml:65:语法错误,意外的输入结束,期望tSTRING_DEND结束;结束;结束;结束^

我也试过了,但它没有工作:

 ng: { |
        model: {'canvasCtrl.stepToShow.answer', options: 'canvasCtrl.savingsOptions', } |
 } |

感谢您的想法。

1 个答案:

答案 0 :(得分:0)

Have you tried %input{ng_model_options: "{debounce: 250}"}? This works for me from a haml template