JSFiddle - React, Tailwind, and code Playground

by Chris Murphy

HTML

<div ng-app="">
    <div ng-controller="Control1">
        <div>{{count1}}</div>
        <button ng-click="click1()">Call both click methods from controller 1</button>
    </div>
    <div ng-controller="Control2">
        <div>{{count2}}</div>
        <button ng-click="click2()">Call both click methods from controller 2</button>
    </div>
</div>

CSS

</style> <script src="http://code.angularjs.org/1.0.1/angular-1.0.1.min.js"></script> <style>

JavaScript

function Control1($scope) {
    $scope.count1 = 0;

    $scope.click1 = function () {
        $scope.count1++;
    }
}

function Control2($scope) {
    $scope.count2 = 0;

    $scope.click2 = function () {
        $scope.count2 = $scope.count2 + 2;
    }
}