Dmitry Dmitry - 1 year ago 69
AngularJS Question

Several (multi) functions of the controller AngularJS

I want to use several functions in one controller. First family makes a request, the second part of the page should display by pressing the button (as here
The first function is working fine, but the second is not.

app.controller('DemoCtrl', function($http) {},function($scope){})

This is the second function of the controller:

$scope.myFunc=function() {

As planned at the touch of a button should show the page:

<body ng-app="jsbin">
<div ng-controller="DemoCtrl as vm">
<button ng-click="myFunc()">Click Me!</button>
<div ng-show=vm.showMe>


Answer Source

angular controller takes one function with all dependencies. app.controller('DemoCtrl', function($http,$scope) { $scope.showMe=false;

 $scope.myFunc=function() {

 $scope.makeAjax= function(){


got through this link

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download