i have this code, which gets a json, inside a controller i need to know how am i able to call inner method, from outside controller.
var app;
(function (){
app = angular.module("gallery", []);
app.controller("galleryController", ['$scope','$http', function($scope, $http){
var gallery = this;
gallery.data = [];
gallery.getJson = function(){
$http.get('/urltojson/main-hero.json').success(function(data){
gallery.data = data;
});
}
this.getJson();
}]); })();
is it possible to call getJson from outside the controller?
{{gallery.data.lowertext}}
{{gallery.data.lowertext}}
– Sebastian Uriel Murawczik Jul 29 '14 at 16:03