Вы находитесь на странице: 1из 3

AngularJS Expression | Java Web Tutor

Privacy Policy

Contact

About Us

Home

Java

JavaEE

Frameworks

Spring

Web Services

Web

Misc

Tools & Tips

Adds
Tutorials On Web Design

Home
>>
AngularJS

English Tutoring

AngularJS - Expressions
Online Algebra Tutoring
April 10, 2016
by
Mukesh Kumar
at
3:47 pm

Homework Tutor

What is AngularJS Expressions

AngularJS Expressions are used to bind


application data to html.It starts with "{{" and
ends with "}}".AngularJS application expressions
are pure JavaScript expressions and outputs the
data where they are used.

AngularJS Tutorial

Student Tutors

AngularJS Overview
Online Tutoring Services

AngularJS Components
AngularJS Repeaters (ng-repeat directive)
AngularJS Filters

Popular Posts
Integrating JSP,Servlet and Hibernate in
an MVC application

You can write expressions on


Numbers,Strings,Objects,Arrays

Hibernate Query Language HQL select,


Update And Delete Example

Hibernate Query Language

AngularJS expressions can also be written


inside ng-bind directives

JSF Page Navigation Tutorial


JSF Validation Tutorial
Hibernate One-To-Many XML Mapping

AngularJS Expression Example

JSF Example: Using JSF 2.0, Eclipse, And

AngularJS expression can contain literals,


operators and variables like JavaScript
expression. For example, an expression {{10/2}}
will produce the result 5 and will be bound to
HTML.

Maven
Jboss Tools Installation in Eclipse
Jboss Installation in Eclipse
Database Application Using JSF
Java Web Application With Maven
Spring HelloWorld Example Using Eclipse
And Maven

Example

EJB3 and JPA Example

HTML

Result

EDIT ON

Mukesh Kumar
<html ><head>
<script
src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script></head><body
>
<h1>AngularJS Expression Example:</h1><div ng-app>
10 + 2 = {{10 + 2}} <br />
2 - 2 = {{2 - 2}} <br />
10 * 2 = {{10 * 2}} <br />
2 / 2 = {{2 / 2}}
</div>
</body></html>

file:///C/Users/ScNayak/Desktop/AngularJS/6%20AngularJS%20Expression%20_%20Java%20Web%20Tutor.htm[10/9/2016 12:49:02 AM]

AngularJS Expression | Java Web Tutor

AngularJS expression can contains literals of any data type.


Example:

HTML

EDIT ON

Result

<html ><head>
<script
src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script></head><body
>
<h1>AngularJS Expression Example:</h1><div ng-app>
{{"Hello World"}}<br />
{{100}}<br />
{{true}}<br />
{{95/10}}
</div></body></html>

AngularJS expression can contain variables declared via ng-init directive. Consider the example
given below.

HTML

EDIT ON

Result

<html ><head>
<script
src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script></head><body
>
<h1>AngularJS Expression Example:</h1><div ng-app ng-init="message='Hello World!'; amount=
5000;rateOfInterest = 12.5; duration=10; myArr = [100, 200]; person = { firstName:'Mukesh',
lastName :'Kumar'}">
{{ (amount * rateOfInterest * duration)/100 }}<br />
{{myArr[1]}} <br />
{{person.firstName + " " + person.lastName}}
</div></body></html>

In Next Chapter we will discuss about AngularJS - Modules

References :- AngulaJS Documentation

Related Articles
1. Maven Overview

Index

0
Comments

javawebtutor

file:///C/Users/ScNayak/Desktop/AngularJS/6%20AngularJS%20Expression%20_%20Java%20Web%20Tutor.htm[10/9/2016 12:49:02 AM]

Login

AngularJS Expression | Java Web Tutor


Recommend

Share

Sort by
Best

Start the discussion

Be the first to comment.

ALSO ON JAVAWEBTUTOR

AngularJS - Controllers

JPA Example using Maven and Hibernate as


JPA Provider

1 comment

3 months ago

mmm AngularJS Controllers-----------------------What is Controllers--------------------The controller in

Web Application With Hibernate,JSP and


Servlet using Eclipse

1 comment

6 months ago

Puffy Fish Good Jpa hibernate and maven

example. One thing that is missing in the


persistence.xml is the declaration of

Introduction to Spring Framework

1 comment

2 years ago

1 comment

7 days ago

mukesh Spring Autowiring by Name Example ---

Tshepo Mokgoatjane Thank you for a great

tutorial, much appreciated. I would like to know


something regarding adding multiple records in

------------------------------- In Autowiring by Name


mode, spring framework will try to find out a

Top of Page

About Us
Privacy Policy
Contact Us
javawebtutor.com 2013-2016

DISCLAIMER

Oracle & Java are registered


trademarks of Oracle and/or its

affiliates. Other names may be


trademarks of their respective
owners. javawebtutor.com is not
connected to Oracle Corporation
and is not sponsored by Oracle
Corporation.The Examples &
Tutorial provided here are for
learning purpose only. we do not
warrant the correctness of
its
content. The risk from using it lies
entirely with the user.

ABOUT US

FREE
EBOOKS

javawebtutor.com is a site
dedicated to bringing you the
coolest java and related web
development tutorials and
resources.
ABOUT US

LEARN MORE

file:///C/Users/ScNayak/Desktop/AngularJS/6%20AngularJS%20Expression%20_%20Java%20Web%20Tutor.htm[10/9/2016 12:49:02 AM]

Download
ebooks.

DOWNLOAD IT

Вам также может понравиться