In the above example, several code problems are running. To start, function2 not declared properly.
You wrapped your getDetails function in a so-called self - signed anonymous function . This means that it is not displayed for code outside the SEAF shell, including function2 . Omit the SEAF shell, so getDetails is determined when function2 wants to use it.
Finally, you use Angular, but assigning function2 - this on the controller. This is probably not what you wanted to do; the functions you want to open in HTML must be bound to $scope , not this .
'use strict'; angular.module('customer').controller('Controller', ['$scope', '$state', 'Sservice', function($scope, $state, Sservice) { function getDetails() {
source share