我的观点中有这个标记
<div id="PeoplePickerDiv"
data-office-control="Office.Controls.PeoplePicker"
data-office-options='{{optionsControlPicker}}'>
Loading users...
</div>
这个代码在我的控制器上
$scope.optionsControlPicker = {
allowMultipleSelections: false,
placeholder: "Find a user 123...",
onChange: function (ctrl) { alert('cambie') }
}
这是结果
<div data-office-options="{"allowMultipleSelections":false,"placeholder":"Find a user 123..."}" ...
Angular不渲染onChange函数。有没有办法渲染该方法?
看起来应该是这样的
<div data-office-options="{
"allowMultipleSelections" : false,
"placeholder" : "Find a user ...",
"onChange" : function(ctrl){ alert("cambie") }
}" ....