Search code examples
javascriptangularjsangularjs-components

Include angular component inside of another app


I have an angular component built with angular 1.5.*. I want to include this component inside of an existing angular application. Is that possible? Can two-way binding be accomplished this way?

I can provide more details if needed but the basic structure is this:

<div ng-app="myApp" ng-controller="myController as vm">
    <my-component selection="vm.selection">
</div>

myComponent is located in another angular module.

Right now the page just doesn't render the component at all but there are no errors. It looks like the component code is just skipped.


Solution

  • Inject the another module dependency in this module. Hope this will work...