Answer the question
In order to leave comments, you need to log in
Is it necessary to expand the directive when it is necessary to pre-calculate its parameters?
Here's the thing. There is a module angular-vidoe-bg which has a directive that expects ratio in the parameters, which is responsible for the format-scale of the video. And so it turns out that the best proportions can be achieved by calculating this ratio yourself.
And this means that somewhere you need to write code that recognizes the screen sizes and, after calculations, transfers these values to the directive.
But what is the best way to do this? Several options come to mind. At initialization, but this is at the configuration level of the application itself, which is already wrong.
There is also an idea to expand the directive with a directive. But I don't quite understand how to do it. I found an article on Habré, but there the author shows how to extend the ideal native directive.
Here.. What to do?
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