V
V
vasIvas2015-08-04 19:01:45
Angular
vasIvas, 2015-08-04 19:01:45

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']);

And more .. I tried all the options about which I could only find reading material. And in compile compiled and already with id replaced and connected by file. But the most that I managed to achieve is the complete replacement of tags in the page, but not work. This plugin also has its own, I would say nuance, the value of video-id="'id'" must be passed in single quotes. But when I did, the page showed that it was. And I also tried to insert values ​​from the osprey and could not in general ...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
_
_ _, 2015-08-04
@vasIvas

Remove replace: true

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question