JSFiddle - React, Tailwind, and code Playground

by dream apple

HTML

<div ng-app="MyApp">
    <div ng-controller="ParentController">
        <h3>Parent Section: {{person.name}}</h3><br/>
        <button ng-click="parentChangeName()">parentChangeName</button>
        <div ng-controller="ChildController">
            <h3>Child Section: {{person.name}}</h3><br/>
            <button ng-click="childChangeName()">childChangeName</button>
        </div>
    </div>
</div>

JavaScript

angular.module("MyApp", [])
.controller("ParentController", function($scope){
    // $scope.name = "dreamapple";
    $scope.person = {
        name: "dreamapple"
    };
    $scope.parentChangeName = function(){
        // $scope.name = "parent dreamapple";
        $scope.person.name = "parent dreamapple";
    }
})
.controller("ChildController", function($scope){
    $scope.childChangeName = function(){
        // $scope.name = "child dreamapple";
        $scope.person.name = "child dreamapple";
    }
});