Answer the question
In order to leave comments, you need to log in
How to assign a js function to a block in angular?
There is some js function - fullCalendar() in the included file. Big.
On the old version of the page:
<script>
$(document).ready(function () {
$('#calendar').fullCalendar();
});
<script>
...
<div id="calendar">
</div>
<script>
$(document).ready(function () {
$('#calendar').fullCalendar();
});
<script>
Answer the question
In order to leave comments, you need to log in
Write a directive for the #calendar element.
Suppose it was and will become so
a directive in a separate file like my-calendar.directive.js
function Directive () {
return {
restrict: 'A',
link: link
};
function link (scope, element) {
element.fullCalendar();
}
}
angular
.module('app.shared')
.directive('my-calendar', Directive);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question