N
N
Nikolay Semenov2016-09-28 16:44:17
Angular
Nikolay Semenov, 2016-09-28 16:44:17

Angular doesn't want to render the template. Why?

<!DOCTYPE html>
<html lang="ru" ng-app="calendarApp">
<head>
  <meta charset="UTF-8">
  <title>Colendar</title>
  <link rel="stylesheet" href="css/bootstrap.min.css">
  <link rel="stylesheet" href="css/colendar.css">
</head>
<body>
  {{1+1}}
  <div class="container">
    <div class="row">
      <div class="col-md-12">
        <calendar></calendar>
      </div>
    </div>
  </div>
  <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.min.js"></script>
  <script src="js/calendar.js"></script>
</body>
</html>

here is the calendar.js file
var app = angular.module('calendarApp', []);
app.directive('calendar', function(){
  return {
    restrict: 'E',
    templateUrl: '../tmpl/month.html'
  };
});

the template at the address is:
<div class="col-row-fluid">
  <div class="col-cel1">s</div>
  <div class="col-cel1">s</div>
  <div class="col-cel1">s</div>
  <div class="col-cel1">s</div>
  <div class="col-cel1">s</div>
  <div class="col-cel1">s</div>
  <div class="col-cel1">s</div>
</div>
dddd

Guys help. Why doesn't it output. Angular connected {{1+1}} = 2

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
nuclear_kote, 2016-09-28
@nickola105

You need to run it from under the web server and everything will work

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question