Angularjs

Angular JS Expressions

Angular JS expressions are written inside double braces. Syntax:{{expressions}}

It works same way as ng-bind directive. They can contain literals, operators and variables.


<!DOCTYPE html>
<html ng-app="techkatakviewer">
  <head>
    <script data-require="[email protected]*" data-semver="1.3.0-beta.5"
    src="<a href="https://code.angularjs.org/1.3.0-beta.5/angular.js%22%3E%3C/script">https://code.angularjs.org/1.3.0-beta.5/angular.js"&gt;&lt;/script</a>&gt;
    &lt;link rel="stylesheet" href="style.css" /&gt;
    &lt;script src="script.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;h1&gt;"Hello Angular JS!!"&lt;/h1&gt;
    &lt;div ng-controller="MyController"&gt;
      {{message}}
    &lt;/div&gt;   
    &lt;div ng-controller="MyController1"&gt;
      &lt;div&gt;First name: {{person.firstname}}&lt;/div&gt;
      &lt;div&gt;Last name: {{person.lastname}}&lt;/div&gt;
      &lt;div&gt;welcome {{person.firstname}} {{person.lastname}} &lt;/div&gt;
    &lt;/div&gt;
  &lt;/body&gt;
&lt;/html&gt;

OutPut:

hello, Angular !!
First name: Tech
Last name: Katak
welcome Tech Katak

© 2015, www.techkatak.com. All rights reserved.