0👍
Reference your vue files in jade (in express app, layout.jade) after block contents not inside the body tag:
body
//not here
block content
script(src="./javascripts/vueapp.js")
0👍
In "jade": "1.9.2"
, if you have following in JS:
res.render('blog_edit', {title: 'edit your blog', posts: "something"});
In template, you can use either of follwing:
#{locals.posts}
or
#{posts}
0👍
First thing to check,
-
did you specified ng-controller? if not, you should.
body(ng-app="myApp" ng-controller="MainCtrl as main")
-
does your controller has that value? if not, you can create test code.
$scope.test = "test"
p {{ test }}
-
did you include angular.js?
script(src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0/angular.min.js")
-
did you correctly create angular app?
var app = angular.module('myApp');
app.controller('MainCtrl', function($scope){
$scope.test = "test";
} -
did you include your angluar app?
script(src="javascripts/myApp.js")
-
{{ }} should not have space between { and {.
If you still have a problem let me know.
0👍
There is an alternative. Just put ng-bind, like this:
div(ng-app="" ng-init="name=' Rodrigo'")
p My name is
span(ng-bind="name")
Jade is no longer Jade hahaha, now it’s Pug.js
I know we are in 2018, but this is my small contribution