Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var add_controller= function(obj, ctrl) {
- var args = ctrl.args.slice();
- args.push(ctrl.method);
- return obj.controller(ctrl.name, args);
- };
- var ctrl = {
- name: 'PhoneListCtrl',
- args: ['$scope', '$http',],
- method: function ($scope, $http) {
- $http.get('phones/phones.json').success(
- function(data) {
- $scope.phones = data;
- }
- );
- $scope.orderProp = 'age';
- }
- };
- add_controller(phonecatApp, ctrl);
Advertisement
Add Comment
Please, Sign In to add comment