JSFiddle - React, Tailwind, and code Playground
by Minko Gechev
HTML
<div ng-app="app" ng-controller="MainCtrl">
<div d1></div>
<div d2></div>
<div ng-controller="SideCtrl"></div>
</div>
JavaScript
window.app = angular.module('app', [])
.directive('d1', function () {
return {
// scope: {},
template: '<div ng-bind="value"></div>',
controller: 'SideCtrl'
};
})
.directive('d2', function () {
return {
// scope: {},
template: '<input type="text" ng-model="value" />',
controller: 'SideCtrl'
};
})
.controller('MainCtrl', function ($scope) {
$scope.value = 'No value';
})
.controller('SideCtrl', function ($scope) {
$scope.value = 'No value of the SideCtrl';
});