Answer the question
In order to leave comments, you need to log in
Why doesn't ng-controller work in jade?
ng-controller and everything after it does not work. I tried writing in html and it worked.
<!DOCTYPE html>
html(lang="ru" ng-app="DemoCtrl")
head
meta(charset="UTF-8")
link(rel="stylesheet", href="css/style.css")
script(src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.9/angular.min.js")
script(src="js/all.js")
title appEx
body
.container
{{ 2 + 8 }} //-работает
h1 ExampleApp
form.search#search
p.text-search
input.field-search(type="search" name="search" placeholder="Поиск по сайту")
input.button-search(type="submit" value="Найти")
hr
.books(ng-controller="example")
.book
{{ 2+12 }} //-не работает
h3.work {{name}} //-не работает
var DemoCtrl = angular.module('DemoCtrl', []);
DemoCtrl.controller('example', function ($scope) {
$scope.name = "lorem ipsum dolor"
});
Answer the question
In order to leave comments, you need to log in
https://output.jsbin.com/besujeqeke - everything works, check indentation in jade or build in html.
Ну так попробуйте на другую строку перенести {{name}} ведь {{ 2 + 8 }} на одной строке а {{name}} на одной строке с h3.work
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question