This is my controller:
var app = angular.module('myApp', [ 'ngMaterial' ]);
app.controller('searchController',['$scope','$http',function($scope,$http) {
this.selectedItemChange = function(item) {
$http.get("url").then(function(response) {
this.initializeProfiles();
});
}
this.initializeProfiles = function() {}
}
But I am getting the error TypeError: this.initializeProfiles is not a function
.
How do I access initializeProfiles()
inside the .then of $http.get?