1

I'm learning AngularJS with Dan Wahlin's tutorial (http://youtu.be/i9MHigUZKEM?t=13m35s). I have the following code in my views/index.jade:

!!! 5
html(data-ng-app='')
  head
    title Angular Tutorial
  body
    | Name:
    br 
    input(type='text', data-ng-model='name') | {{name}}

    script(src='https://ajax.googleapis.com/ajax/libs/angularjs/1.0.8/angular.min.js', type='text/javascript')

But when I run the app, and type anything in the Name box, it does not display the text like it does in the tutorial. What am I doing wrong?

1 Answer 1

6

Put your binding on the next row. The previous one sets it inside the input (which doesn't make sense).

input(type='text', data-ng-model='name')
| {{name}}
Sign up to request clarification or add additional context in comments.

2 Comments

thanks! could you please explain this a little more? why does having it on the same line set it inside the input?
Compare it to placing text inside of paragraph tag: p Foobar.

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.