Jesse Lawson

Software engineering, artificial intelligence, writing, and open-source tools

Jan 1, 0001 - AngularJS Code Snippets Tutorials

Fix for ng-include Files Not Appearing

If you’re using ng-include and your partials aren’t showing up, you probably forgot that the location of your partial needs to be encapsulated in both double quotes and single quotes. Instead of this:

You need to have this:

This reason this works and the way you’ve been doing it does not because ng-include requires a string to be passed to it. Technically, just putting in header.html is tantamount to putting in the name of a scope variable; you need to encapsulate the location of your file in single quotes in order to tell AngularJS that you are passing a string.