Skip to content

Instantly share code, notes, and snippets.

@zeptobook
Created October 20, 2018 22:49
Show Gist options
  • Save zeptobook/5434307fdac904743dd04e2186e16dba to your computer and use it in GitHub Desktop.
Save zeptobook/5434307fdac904743dd04e2186e16dba to your computer and use it in GitHub Desktop.
test gist
<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