2

My code like

 <p>Input something in the input box:</p>
 <p>Name : <input type="text" ng-model="name" placeholder="Enter name here" value="something" ></p>
 <h1>Hello {{name}}</h1> 

I want to display output like

Input something in the input box:
**Hello something** (by default)

1 Answer 1

2

You could use ng-init in your case like ng-init="name='somthing'"

Markup

<p ng-init="name='somthing'">Input something in the input box:</p>
 <p>Name : <input type="text" ng-model="name" placeholder="Enter name here" /></p>
 <h1>Hello {{name}}</h1> 
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.