JSFiddle - React, Tailwind, and code Playground

by viralpatel

HTML

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

	<button ng-click="clickme()">Click Me</button> 

</div>

JavaScript

function CarController($scope) {
 
	$scope.name = 'Car';
	$scope.type = 'Car';
 
	$scope.clickme = function() {
		alert('This is parent controller "CarController" calling');
	}

}

function BMWController($scope, $injector) {
    
    $injector.invoke(CarController, this, {$scope: $scope});
    
    $scope.name = 'BMW';
 
}