0
<!DOCTYPE html>
<html lang="en" ng-app>
  <head>
    <title>TheNetNinja Angular Playlist</title>
    <link href="content/css/styles.css" rel="stylesheet" type="text/css" />
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.10/angular.min.js"></script>
    <script src="app/lib/angular.min.js"></script>
  </head>
  <body>
    <input type="text" ng-model="favMeat" placeholder="enter your fav meat" />
    <p>Your fav meat is: {{ favMeat }} </p>
  </body>
</html>

The text box and the words below it are showing up, but the 'favMeat' value is not showing up when I type in the text box. I'm also running this on a local server built into the atom text editor. I would guess it has something to do with my src files? If I comment out the second src it still doesn't work.

0

1 Answer 1

1

First of all there is no angularjs2 , its just angular 1.x or angular 2/4/5/6.

Just remove the duplicate reference to angular.js

Anyhow the above code works,

 
<!DOCTYPE html>
<html lang="en" ng-app>
  <head>
    <title>TheNetNinja Angular Playlist</title>
    <link href="content/css/styles.css" rel="stylesheet" type="text/css" />
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.10/angular.min.js"></script>
    
  </head>
  <body>
    <input type="text" ng-model="favMeat" placeholder="enter your fav meat" />
    <p>Your fav meat is: {{ favMeat }} </p>
  </body>
</html>

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

4 Comments

It works only if I take all of the other text out of the p tag and just have the variable.
did you have a look at the demo?
Yeah it works in the demo. Maybe it's my text editor.
it does not have anything to do with the editor i guess

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.