I'm new over here in stackoverflow.
Well I have a problem with my code and i couldn't find a solution, so I decide to ask my question here.
HTML
<body ng-app="app">
<div ng-controller="ctrl">
</div>
<script src="~/Scripts/angular.min.js"></script>
I included ng-app="app" in my body and I installed angularjs as well.
I added a javascript file in my application called ang.js
ang.js
var app = angular.module('app', [])
app.controller("ctrl", function ($http) {
$http.get("url1")
.success(function (response){
console.log(response);
})
$http.get("url2", {
params: {
Id: response[0].key
}
.success(function (response2) {
console.log(response2);
})
})
})
My question is in
.success(function (response){
console.log(response);
})
How can i call this parameter response in the second one.
$http.get("url2", {
params: {
Id: response
}