Search code examples
angularjsmodulerenderpartial

Angular JS rendering partial from different module


Hello experienced lamp / ror /ios dev . complete mean stack super noob here.

background:

I want to render SignUp partial in home

home dir is under Core Module with home Controller sign up is under Users Module with AuthenticationController

used MEANJS boilerplate scaffolding with Yeoman


I initially put my form inside home.client.view.html but it is not modular want to keep the Signup with Users module

here is my sad attempt

<section data-ng-controller="AuthenticationController">
     <div data-ng-include data-ng-src="signup.client.view.html"></div>
</section>

inside the core client I added users module as so

ApplicationConfiguration.registerModule('core');
ApplicationConfiguration.registerModule('users');

what am i doing wrong

please do not link the documentation


Solution

  • You simply have to put your template's source in a quotation marks (this example defines the source immediately on the ng-include part):

    <div data-ng-include="'signup.client.view.html'"></div>
    

    Here is a Plunker Example.