Last active
August 29, 2015 14:14
-
-
Save metasansana/c2e242ff3b4d298a3a45 to your computer and use it in GitHub Desktop.
Generic Form as directive with controller
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
var app = angular.module('myApp', []); | |
app.directive('contactGeneric', function () { | |
return { | |
restrict: 'E', | |
templateUrl: 'contactGeneric.html', | |
bindToController: true, | |
controllerAs: 'contactGeneric', | |
controller: ['$http', function ($http) { | |
$http.get('/data').then(function (res) { | |
this.data = res.data; | |
}.bind(this)); | |
}] | |
}; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment