-
Notifications
You must be signed in to change notification settings - Fork 114
Dev.front js angular
nothing edited this page Jan 3, 2014
·
14 revisions
- phtml value assign to ng html template
//phtml
angular
.module('<?php echo $module; ?>', ['ngRoute', 'pi'])
.constant('config', {
//Translate ng template
t: {
key1: <?php echo _a('value1'); ?>
},
//phtml data assign to module config
data: {
list: <?php echo json_encode($list); ?>
}
});
//{{module}}/asset/admin/{{controller}}.js
angular.module('{{module}}')
.controller('privacyCtrl', ['$scope', 'config',
angular.extend($scope, config.data);
]);
//{{module}}/public/ng-template/admin/{{controller-action.html}}
<tr ng-repeat="item in list">
<td>{{item.title}}
<td>{{item.description}}