videoSrc variable not evaluating properly
images/{{videoSrc}}.mp4
if i'm writing only videoSrc then its working propely but while concating with other string it is not working
see jsfiddle
videoSrc variable not evaluating properly
images/{{videoSrc}}.mp4
if i'm writing only videoSrc then its working propely but while concating with other string it is not working
see jsfiddle
You can use template: fn way see example bellow
angular.module('myApp', []).directive('videoPopup', function() {
return {
strict: 'A',
scope: {
videoSrc: '@'
},
replace:true,
template: function(tElem, tAttrs){
return '<video width="100%" controls><source
src="images/'+tAttrs.videoSrc+'.mp4" type="video/mp4"><source src="images/'+tAttrs.videoSrc+'.webm" type="video/webm"></video>'
}
}
});