Created
June 28, 2015 07:18
-
-
Save aregee/7fa5d3b45b226e22c473 to your computer and use it in GitHub Desktop.
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
/* | |
* Calaca - Search UI for Elasticsearch | |
* https://github.com/romansanchez/Calaca | |
* http://romansanchez.me | |
* @rooomansanchez | |
* | |
* v1.2.0 | |
* MIT License | |
*/ | |
/* Calaca Directive | |
* | |
* <dynamic-element message='htmlString'></dynamic-element> | |
* | |
*/ | |
Calaca.directive('dynamicElement', ['$compile', function ($compile) { | |
return { | |
restrict: 'E', | |
scope: { | |
message: "=" | |
}, | |
replace: true, | |
link: function(scope, element, attrs) { | |
var template = $compile(scope.message)(scope); | |
element.replaceWith(template); | |
}, | |
controller: ['$scope', function($scope) { | |
$scope.clickMe = function(){ | |
alert("hi") | |
}; | |
}] | |
} | |
}]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No Results
{{result.title}}