Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div ng-app="printers">
- <div ui-view></div>
- </div>
- (function() {
- 'use strict'
- angular.module('printers.controller', [])
- angular
- .module('printers',
- ['ngAnimate',
- 'ui.router',
- 'templates',
- 'ngResource',
- 'printers.controller',
- 'orders.factories'
- ])
- .config(function ($stateProvider, $urlRouterProvider, $locationProvider) {
- /* Routes and States*/
- $stateProvider
- .state('printers.orders.index', {
- url: '/printer_orders_index',
- templateUrl: 'orders_index.html',
- controller: 'PrintersController'
- })
- // default fall back route
- $urlRouterProvider.otherwise('printers_orders_index')
- })
- })()
- (function() {
- 'use strict'
- angular
- .module('printers.controller')
- .controller("PrintersController", PrintersController)
- PrintersController.$inject = ['$scope', 'Order']
- function PrintersController($scope, Order){
- Order.query({}, function(response){
- $scope.orders = response.orders
- $scope.printer_id = response.meta.printer_id
- })
- }
- })()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement