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

1

1 Answer 1

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.