JSFiddle - React, Tailwind, and code Playground

by Khajan Singh

HTML

<div ng-app="example">
<div ng-controller="ParentCtrl">
    {{cities}}
    <div ng-controller="ChildCtrl">
      {{parentcities}}
    </div>
</div>
</div>

JavaScript

var example = angular.module("example", []);
function ParentCtrl($scope) {
console.log($scope);
    $scope.cities = ["NY", "Amsterdam", "Barcelona"];
    $scope.setMasters = function(value){
    	$scope.masters = value;
    };
}
ParentCtrl.$inject = ["$scope"];
function ChildCtrl($scope) {
console.log($scope);
    $scope.parentcities = $scope.cities;
    $scope.setMasters("Child token = 099");
}
ChildCtrl.$inject = ["$scope"];

example
	.controller("ParentCtrl", ParentCtrl)
	.controller("ChildCtrl", ChildCtrl);