[Vuejs]-Display {{ }} Jade-Angular-React-Vue

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")
👤Marco

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,

  1. did you specified ng-controller? if not, you should.

    body(ng-app="myApp" ng-controller="MainCtrl as main")

  2. does your controller has that value? if not, you can create test code.

    $scope.test = "test"
    p {{ test }}

  3. did you include angular.js?

    script(src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0/angular.min.js")

  4. did you correctly create angular app?

    var app = angular.module('myApp');
    app.controller('MainCtrl', function($scope){
    $scope.test = "test";
    }

  5. did you include your angluar app?

    script(src="javascripts/myApp.js")

  6. {{ }} should not have space between { and {.

If you still have a problem let me know.

👤ibocon

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

Leave a comment