Sunday, May 6, 2018

AngularJS Basic

// Define your module. Your module will contain all your
// AngularJS components, including your controllers,
// directives and services.

// Don't forget the square brackets [] when you define
// your module.
var module = angular.module("myModule", []);

// Define you controllers. You bind these to your HTML
// elements using the "ng-controller" attribute.
//
// The $scope  is how you share data and functions
// between the HTML and your controller.
module.controller("myController", function($scope) {
$scope.message = "Hello World";

  $scope.changeMessage = function() {
    // when you change a variable in the $scope
    // the UI is automatically updated with the change
$scope.message = "Hello Universe!";
  };
});


    You clicked the button {{clickCount}} times.
   

angular.module("MyModule", [])
    .controller("MyController", function($scope) {
        $scope.clickCount = 0;

        $scope.userClick = function() {
            $scope.clickCount++;
        };

    });

No comments:

Post a Comment

Driving

 https://youtube.com/shorts/5Ac2qZHrApU?si=_X-G7pJFHiZoD-s7 https://www.youtube.com/watch?v=f6pSsex87oU