0

I am new to angularJS. So, may be I am asking very naive question. I have downloaded angularjs 1.3.16 and tried to make a very basic example, which is as given below. When I run in browser(chrome) it doesn't show any thing, while I am expecting, Input text box as well as Hello2 printed by its side.

    <html>
        <head>
          <script src="../angular-1.3.16/angular.min.js" />
        </head>
        <body ng-app>
            <input type="text">
            Hello {{2}}
        </body>
    </html>

I don't know, what wrong am I doing ? Please help me out. Moreover, any more things that I should keep in mind, while developing angularjs code to avoid silly errors, then let me know.

4 Answers 4

2

You didn't close your script tag

Try like this

<script src="../angular-1.3.16/angular.min.js" ></script>

Demo

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

Comments

0

You need to close the script tag. Make sure you are using a valid version with valid path

<script src="../angular-1.3.16/angular.min.js" ></script>

Demo

Comments

0

Use ng-init like as close the tag as below

<script src="../angular-1.3.16/angular.min.js" ></script>

This good for writing script

   <body ng-app ng-init="firstName='Hello2'">
                <input type="text">
               {{ firstName }}
            </body>

DEMO

Comments

0

Add App name in ng-app and close the script tag.

e.g.

<script src="../angular-1.3.16/angular.min.js"> </scrpt>

<body ng-app="myApp">

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.