13

My angular project's path is like this

web
    server.py ##flask server program
    app
        static
            app.js
            controllers.js
            etc...
        templates
            index.html
            home.html

index.html

<!-- this didn't work -->
<ng-include src="templates/home.html"><ng-include>

<!-- nor did this -->
<ng-include src="home.html"></ng-include>

home.html

<h1> home! </h1>

Except I don't see the partial (home.html) in my output.

Anyone see my mistake?

isherwood
  • 58,414
  • 16
  • 114
  • 157
Zack
  • 13,454
  • 24
  • 75
  • 113

1 Answers1

34

The src attribute of ng-include expects a string. Either you pass a scope variable, or pass string directly.

<ng-include src=" 'templates/home.html' "></ng-include>
Fergus
  • 2,821
  • 2
  • 27
  • 41
Raghavendra
  • 5,281
  • 4
  • 36
  • 51