Answer the question
In order to leave comments, you need to log in
How to override a directive?
Yesterday it didn’t work out and today I’ve been sitting for the third hour and I don’t know what to do. I read a lot of things, but I did not find the answer. If someone can look, I will be very glad - derictive . Just in case, I copied the code here. If you remove extended, you can see that the expandable directive works. And one more thing... In the first example, they showed me that I need to put the '=?' sign, but when I saved the example, an error began to pop up and I removed the question mark. In the realm example, I tried this and that.
<html lang="en"></html>
<head>
<meta charset="UTF-8"/>
<title>angular</title>
<script src="//cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.14/angular.min.js"></script>
<script src="https://rawgit.com/kanzelm3/angular-video-bg/master/angular-video-bg.min.js"></script>
</head>
<body>
<video-bg-extended video-id="'iNJdPyoqt8U'"></video-bg-extended>
</body>
var app = angular.module('app', ['angularVideoBg']);
app.directive('videoBgExtended', ()=>{
console.log('#################')
return {
scope: {
videoId: '='
},
restrict: 'EA',
replace: true,
template: '<video-bg video-id=""></video-bg>'
};
});
angular.bootstrap(document, ['app']);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question