JSFiddle - React, Tailwind, and code Playground

by Akram kamal

HTML

<div ng-app="" ng-controller="CarController">
    My name is {{ name }} and I am a {{ type }}
     
    <div ng-controller="BMWController">
        My name is {{ name }} and I am a {{ type }}
 
        <div ng-controller="BMWMotorcycleController">
            My name is {{ name }} and I am a {{ type }}
 
        </div>
    </div>
</div>

CSS

div {
    margin:10px;padding:10px;
    border:1px solid #ddd;
}

JavaScript

function CarController($scope) {
 
    $scope.name = 'Car';
    $scope.type = 'Car';
 
}
 
function BMWController($scope) {
 
    $scope.name = 'BMW';
 
}
 
function BMWMotorcycleController($scope) {
 
    $scope.name = 'BMWMotorade';
    $scope.type = 'Motorcycle';
 
}