Jak skonfigurować paramater ścieżki w kątowym i dostępny w kontrolerze
$stateProvider.state('transactions', {
url: '/transactions',
templateUrl: url,
menu: 'Transactions'
});
$stateProvider.state('audit', {
url: '/transactions/{id}/audit',
templateUrl: 'url',
});
----------------------
var app = angular.module('myApp', []);
app.controller('auditCtrl', function($scope, $stateParams) {
$scope.transactionId = $stateParams.id;
});
----------------------
app.controller('transactionsCtrl', function($scope, $state) {
$scope.redirectToAudit = function () {
$state.go('audit', {
id: $scope.transactionId;
});
}
});
SAMER SAEID