Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

170
Views
Using Angular with Express-Handlebars for a Node.js application

I have a node.js application running Express and express handlebars as the templating framework. I have recently started learning Angular and integrating it in my node.js app.

The only issue is, the markup for express-handlebars and angular is same. Both framework use {{}}. I did some research and found this Stackoverflow question: Using Express Handlebars and Angular JS

The accepted answer suggests changing the markup symbols using the interpolateProvider. I implemented this and it does not work for me (I have commented under that answer).

My code looks like this:

main.handlebars

<!DOCTYPE html>
<html ng-app="myapp">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <title>GETTING STARTED WITH Angular</title>
        <meta name="description" content="An interactive getting started guide for Brackets.">
        <link rel="stylesheet" href="/css/style.css"/>
        <script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.1/angular.min.js"></script>
        <script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.1/angular-route.min.js"></script>
        <script>
            var app = angular.module("myApp", []);
            app.config(function($interpolateProvider) {
                $interpolateProvider.startSymbol('//');
                $interpolateProvider.endSymbol('//');
            });


            app.controller('DemoController', function() {
                this.label = "This binding is brought you by // interpolation symbols.";
            });
        </script>
    </head>
    <body>
        {{{body}}}

        <input ng-model="name">
        <h3>Hi, //name// how are you doing</h3>

        <div ng-controller="DemoController as demo">
            //demo.label//
        </div>
    </body>
</html>

The above code is from the main.handlebars layout file. I even tried to put that code in the actual view but it did not work. What am I missing?

Thanks.

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

This issue is occurring because of an incorrect app name reference or a simple typo. Change ng-app="myapp" to ng-app="myApp".

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!