javascript - Access Controller Function defined in Anonymous Function into HTML5 -


i have defined app.js invoke some-view.view.html , some-view-controller.js. some-view.view.html has ng-click directive call function defined in some-view-controller.js

upon clicking element ng-click directive, function defined in some-view-controller.js not getting called.

please let me know how invoke function defined in some-view-controller.js , access variables linked ng-model.

app.js

    .when('/some-view', {         controller: 'someviewcontroller',         templateurl: 'some-view/some-view.view.html',         controlleras: 'vm'     }) 

some-view-controller.js

    (function () {     'use strict';      angular         .module('app')         .controller('someviewcontroller', someviewcontroller);      someviewcontroller.$inject = ['userservice', '$rootscope'];     function someviewcontroller(userservice, $rootscope) {         /*discussion board related functions*/          var vm = this;          /////         vm.comments = [];         vm.currcmtindx=-1;         vm.userreply="";           function functiontobecalledfrom_ng_click() {                      }              }             /*end - discussion board related functions*/              }   /*end - someviewcontroller  */    })();  

html snippet

<div class="form-group" >     <div class="col-sm-offset-2 col-sm-10">                             <button class="btn btn-success btn-circle text-uppercase" type="button" id="submitcomment" ng-click="vm.functiontobecalledfrom_ng_click()"><span class="glyphicon glyphicon-send" id="qazwsx"></span> summit comment</button> </div>     </div> 


Comments