0

how can I achieve that structure in AnglularJS ?

<body ng-app="mainBodyAppWrapper">
        <div ng-controller = "mainBodyController">
            <div ng-app="myApp">
                <div ng-controller="controller3">
                    First Name : <input ng-model="myApp_fName3" type="text"/>
                    Last Name : <input ng-model="myApp_lName3" type="text"/>
                    Hello {{myApp_fName3}} {{myApp_lName3}} !!!
                </div>
                <hr/>
            </div>
        </div>
    </body>

in that case I have an error https://docs.angularjs.org/error/ng/areq?p0=controller3&p1=not%20a%20function,%20got%20undefined

Any one know about that kind of error solution? Please help me out

Ashish Dadhich
  • 4,737
  • 4
  • 17
  • 25
  • Possible duplicate of [How to define two angular apps / modules in one page?](http://stackoverflow.com/questions/12860595/how-to-define-two-angular-apps-modules-in-one-page) – Rahil Wazir Oct 26 '15 at 06:58

1 Answers1

1

You cannot use multiple ng-app in a page. If you really need to use multiple modules, consider bootstraping the second module. For more info, read How to define two angular apps / modules in one page

Community
  • 1
  • 1
Praveen Prasannan
  • 7,093
  • 10
  • 50
  • 70