Question

java- Students create your first basic angular project. Print your name on the screen please help!

java-

Students create your first basic angular project. Print your name on the screen

please help!
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Solution:

Angular JS: Used to develop web applications with minimal effort.

Code:

<html>
<head>  
    <title>My_name</title>   
</head>

<body    ng-app = "basic_prg" >


<h2   ng-controller = "program_ctl"> { {message } } </h2>

''' Main context '''

<script >
    angular.module ("basic_prg", [ ] ).controller ("program_ctl", function ($scope ) {
    $scope.message = "My_name"
    } )
</script >

</body >
</html >

----------------------------------------------------------------------------------------

Explanation:

<html>    -------------> Declaring HTML as an angular JS program.
<head> -------------> Starting of the program

...
    <title>My_name</title>    -------------> Titile name denotes the name at the topbar..
</head>

.
<body ng-app = "basic_prg"> ------------->ng-app is to make the program to denote it is an angular js app.
<h2 ng-controller="program_ctl"> {{message } } </h2> -------------> To control the programs logic

''' Main context '''

..

<script > -------------> Script contains the main context which has to be executed
    angular.module ("basic_prg", [ ]).controller("program_ctl", function ( $scope ) {
    $scope.message = "My_name"     -------------> Printing name on the screen
    } )
</script >

.

</body >
</html> -------------> End of application..

----------------------------------------------------------------------------------------

Output:

Run in browser :- http://localhost:<port_No>/<file_name>

Output My_name

----------------------------------------------------------------------------------------

Add a comment
Know the answer?
Add Answer to:
java- Students create your first basic angular project. Print your name on the screen please help!
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT