我有以下代码:
if(w2ui.hasOwnProperty('layout')){
w2ui['layout'].destroy();
}
if(w2ui.hasOwnProperty('grid')){
w2ui['grid'].destroy();
}
$(function () {
$('#grid').w2grid({
name: 'grid',
show: {
footer: true
},
columns: [
{ field: 'fname', caption: 'Date Time', size: '200px',
render: function (record, index, column_index) {
var html = '<div>'+ record.fname + ' ' + record.lname + '</div>';
return html;
}
},
{ field: 'email', caption: 'Subsystem', size: '100%' },
{ field: 'profit',caption: 'ACCES Message Type', size: '120px', render: 'money' }
],
records: '{{model.messages}}'
//[
// { recid: 1, fname: 'John', lname: 'Doe', email: 'john@gmail.com', profit: 2500},
// { recid: 2, fname: 'Stuart', lname: 'Motzart', email: 'stuart@gmail.com', profit: 1004},
// { recid: 3, fname: 'Jin', lname: 'Franson', email: 'jin@gmail.com', profit: 473},
// { recid: 4, fname: 'Susan', lname: 'Ottie', email: 'susan@gmail.com', profit: 304},
// { recid: 5, fname: 'Kelly', lname: 'Silver', email: 'kelly@gmail.com', profit: 9300},
//]
});
});
</script>
问题是,我怎样才能从 Angular 的控制器中传递数据。
records: '{{model.messages}}'
策略代码的经典之作,项目一个月结束...