Menu icon Foundation

My Posts


  • 7
    Replies
  • Can't make Ng-include work

    By Clara

    angular

    I'm trying to include an html file (footer_navigation.html) inside another (index.html). In index.html I'm pasting the following code (see below). But nothing seems to happen. Both files are on the same folder. Any help appreciated!

    Last Reply by James Stone over 4 years ago




My Comments

Clara commented on Ryan's post over 4 years

Maybe it would help knowing why they are not working. Any console errors? Path problems? Is the code for your top bar and orbit on the index file too?

Clara commented on Clara's post over 4 years

Hi, I've tried with single quotes as suggested. At least now I'm getting something on the console, a 404 error where the non-found path is "http://localhost:8080/footer_navigation.html".

Of course my footer_navigation.html is inside client/templates but so is the file that is including it. So which might be the path problem?

As I don't have any knowledge of Angular I'm a bit confused. Should the footer_navigation.html have the front matter as explained in Angular docs / Dynamic routing. Right now my footer_navigation.html file looks like this (without the ` ):

 `---
name: footer_navigation
url: /footer_navigation
`---
<div class="grid-content" style="padding: 0;">
    <div class="navigation-main title-bar">
        <div class="icon center title">X</div>
        <span class="left"><a href="#" class="icon">&lt;</a></span>
        <span class="right"><a href="#" class="icon">&gt;</a></span>
    </div>
</div>

And the including file has the following code (note the single quotes)

<!--include footer-->
<div ng-include src="'footer_navigation.html'"></div>

Clara commented on ayezee's post over 4 years

There's an open issue at github with a manual fix, if it's any help

https://github.com/zurb/foundation-apps/issues/203

Posts Followed


Following

    No Content

Followers

My Posts

My Comments

You commented on Ryan's post over 4 years

Maybe it would help knowing why they are not working. Any console errors? Path problems? Is the code for your top bar and orbit on the index file too?

You commented on Clara's post over 4 years

Hi, I've tried with single quotes as suggested. At least now I'm getting something on the console, a 404 error where the non-found path is "http://localhost:8080/footer_navigation.html".

Of course my footer_navigation.html is inside client/templates but so is the file that is including it. So which might be the path problem?

As I don't have any knowledge of Angular I'm a bit confused. Should the footer_navigation.html have the front matter as explained in Angular docs / Dynamic routing. Right now my footer_navigation.html file looks like this (without the ` ):

 `---
name: footer_navigation
url: /footer_navigation
`---
<div class="grid-content" style="padding: 0;">
    <div class="navigation-main title-bar">
        <div class="icon center title">X</div>
        <span class="left"><a href="#" class="icon">&lt;</a></span>
        <span class="right"><a href="#" class="icon">&gt;</a></span>
    </div>
</div>

And the including file has the following code (note the single quotes)

<!--include footer-->
<div ng-include src="'footer_navigation.html'"></div>

You commented on ayezee's post over 4 years

There's an open issue at github with a manual fix, if it's any help

https://github.com/zurb/foundation-apps/issues/203

Posts Followed

Following

  • No Content

Followers

  • No Content