JSFiddle - React, Tailwind, and code Playground

by Michele Marcucci

HTML

<div ng-app="docsSimpleDirective">
    <div ng-controller="Controller">
        <button ng-click="showCustomer = true">click to see the customer</button>
        <div my-customer ng-show="showCustomer"></div>
    </div>
</div>

JavaScript

angular.module('docsSimpleDirective', [])
    .controller('Controller', ['$scope', function ($scope) {
        
    $scope.customer = {
        name: 'Naomi',
        address: '1600 Amphitheatre'
    };
        
        $scope.showCustomer = false;
}])
    .directive('myCustomer', function () {
    return {
        template: 'Name: {{customer.name}} Address: {{customer.address}}'
    };
});