Created
October 20, 2018 22:49
-
-
Save zeptobook/5434307fdac904743dd04e2186e16dba to your computer and use it in GitHub Desktop.
test gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div ng-app="myApp" ng-controller="myCtrl"> | |
<div welcome-customer></div> | |
</div> | |
<script> | |
var app = angular.module('myApp', []); | |
app.controller('myCtrl', ['$scope',function($scope) { | |
$scope.customer = { | |
name: 'Adesh', | |
address: '100 Broadway, New York' | |
}; | |
}]); | |
//our custom directive | |
app.directive('welcomeCustomer', function(){ | |
return { | |
template: 'Welcome: {{customer.name}}, Address: {{customer.address}}' | |
}; | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment