JSFiddle - React, Tailwind, and code Playground

by didier_

HTML

<body>
    <div ng-app="MyApp">
        <h1>{{data.message}}</h1>
        <div ng-controller="FirstCtrl">
            <label>Field in the FirstCtrl</field><input type="text" ng-model="data.message">
            <h1>{{data.message}}</h1>
        </div>
        <div ng-controller="SecondCtrl">
            <label>Field in the SecondCtrl</label><input type="text" ng-model="data.message">
            <h1>{{data.message}}</h1>
        </div>
    </div>
  </body>

JavaScript

var MyApp = angular.module('MyApp', []);

MyApp.factory('dataContainer', function(){ return {} });
function FirstCtrl($scope, dataContainer) {
    $scope.data = dataContainer;
    
}

function SecondCtrl($scope, dataContainer) {
    $scope.data = dataContainer;
}