angular-fullstack / generator-angular-fullstack

Yeoman generator for an Angular app with an Express server
https://awk34.gitbook.io/generator-angular-fullstack
6.12k stars 1.24k forks source link

ng-include not rendering in new .jade file #217

Closed kosz closed 10 years ago

kosz commented 10 years ago

First off sorry if it's not appropriate to post this question here, however I'm having an issue when trying to create a new page in an app generated with angular-fullstack.

I've created a new .jade partial, the routing for it as well as a menu item to take me to that route. All of this works fine, however, the

div(ng-include='\'partials/navbar.html\'')

Doesn't get rendered from within this new jade file ( called calendar.jade ). The code is IDENTICAL to the other .jade files generated by the generator : main.jade, settings.jade, login.jade

When inspecting the HTML, it looks like the comment for the ng-include gets rendered, but the actual div doesn't get rendered. Here is a gist with this :

https://gist.github.com/kosz/1a87d115451414fa8136

Copy pasting the content of the ng-include partials, directly in the calendar.jade file, will render everything correctly ... But when using the ng-include only a comment gets rendered, as seen in the gist above.

Anticipated thanks.

educatedrisk commented 10 years ago

I don't know much about Jade but it looks like you render out the ng-include as comments. Is that specifically for Jade or can you try rendering the ng-includes out as attributes of a div tag.

<div ng-include="'partials/footer'"></div>
or
<div data-ng-include="'partials/footer'"></div>
or 
<div ng-include="'partials/footer.url'"></div>
kosz commented 10 years ago

Thanks for your answer. Really weird stuff but I got it working by doing things the proper angular-fullstack way.

This was indeed not a jade problem, the same jade code works now that I've generated the controller using the angular-fullstack generator.

yo angular-fullstack:controller controllername --coffee

did the trick