AngularJS - ng-switch and primitive

by darul75

HTML

<div ng-controller="Controller">
    <div directive></div>
</div>

JavaScript

var app = angular.module('myApp', [])
.controller('Controller', ['$scope', function(scope) {
  scope.customer = {
    name: 'Naomi',
    address: '1600 Amphitheatre'
  };
}])
.directive('directive', function() {
  return {
    // scope = false, we inherit from controller one  
    restrict: 'A',
    template: 'Name: {{customer.name}} Address: {{customer.address}}'
  };
});