stateParams is not defined


#1

app
.state('app.lowongan', { url: '/lowongan/:lowonganId', views: { 'menuContent': { templateUrl: 'templates/lowongan.html', controller: 'LowonganCtrl' } } });

controller
`.controller(‘LowonganCtrl’, function($scope, $http, $stateParams) {
$http.get('http://localhost/loker_web/api/pekerjaan/’+stateParams.lowonganId).success(function(data) {
console.log(data);
$scope.lowongan = data;
});

})`

Any can help me because i get error message “stateParams is not defined” for my code,

Thanks before


#2

How you are sharing the data “lowonganId”?


#3

i dont know about sharing the data, mybe you can help me?


#4

its $stateParams with $


#5

Thanks, i missing that, and now my code is working :sweat_smile: