D
D
Dmitry2015-01-03 15:19:39
JavaScript
Dmitry, 2015-01-03 15:19:39

How to use angular directives in ASP.NET MVC?

Guys, tell me how to use and how to connect the angular directive in ASP.NET MVC?
how to make it so that both the directive template and the directive definition itself are in one file, and how then to connect this file in order to start using the directive?
here is what i want

<div>здесь разметка директивы</div>

 здесь создание директивы
  app.directive('someDirective')...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nicholas, 2015-01-03
@healqq

Umm... If I understand correctly, you just need to make a js file in which the directive will be created, specify the markup in the template property :

app.directive('coolDirective', function() {
    return {
        ...
        template: '%ваша разметка%',
        ...
    }
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question