Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
دوره آموزش AngularJS - مبانی (Basics): http://blog.allii.ir/2016/01/angularjs-beginner-intermediate-course-basics/
<!DOCTYPE html>
<html></html>
<head>
<!-- AngularJS 1.4.8 !-->
<script src="../src/angular.min.js"></script>
</head>
<body ng-app>
String equals to Number? {{'1' == 1}}
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<!-- AngularJS 1.4.8 !-->
<script src="../src/angular.min.js"></script>
</head>
<body ng-app>
{{for (i = 0; i < 100; i = i + 1) {i}}}
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<!-- AngularJS 1.4.8 !-->
<script src="../src/angular.min.js"></script>
</head>
<body ng-app>
{{variable = 5; ++variable}}
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<!-- AngularJS 1.4.8 !-->
<script src="../src/angular.min.js"></script>
</head>
<body ng-app>
<!-- Invalid AngularJS Expression !-->
{{alert("http://blog.allii.ir/")}}
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<!-- AngularJS 1.4.8 !-->
<script src="../src/angular.min.js"></script>
</head>
<body ng-app>
{{"Angular" + "js".toUpperCase() + " FRAMEWORK".toLowerCase()}}
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<!-- AngularJS 1.4.8 !-->
<script src="../src/angular.min.js"></script>
</head>
<body ng-app>
I Have {{variable = 3; (variable > 2) ? "more than ": "less than"}} 2 Apples.
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<!-- AngularJS 1.4.8 !-->
<script src="../src/angular.min.js"></script>
</head>
<body ng-app>
{{variable = 1}} === {{variable}}
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<!-- AngularJS 1.4.8 !-->
<script src="../src/angular.min.js"></script>
</head>
<body ng-app>
I'm variable * 3: {{variable = 5; variable * 3}}
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<!-- AngularJS 1.4.8 !-->
<script src="../src/angular.min.js"></script>
</head>
<body ng-app>
Adding number as AngularJS Expression {{1+1}}
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<!-- AngularJS 1.4.8 !-->
<script src="../src/angular.min.js"></script>
</head>
<body ng-app>
Adding number as AngularJS ng-bind Directive: <span ng-bind="1+1"></span>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<!-- AngularJS 1.4.8 !-->
<script src="../src/angular.min.js"></script>
</head>
<body ng-app>
<div ng-init="myFunction = function(){ return 1; }">
My function return is: {{myFunction()}}
</div>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<!-- AngularJS 1.4.8 !-->
<script src="../src/angular.min.js"></script>
</head>
<body ng-app>
<div ng-init="validVariable = {property1: 'Im a property', arrayProperty: ['1','2']}">
-{{invalidVariable.arrayProperty[1]}}<br/>
-{{validVariable.invalidProperty.property1}}<br/>
-{{validVariable.arrayProperty[2]}}
</div>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<!-- AngularJS 1.4.8 !-->
<script src="../src/angular.min.js"></script>
</head>
<body ng-app>
<div ng-init="variable1 = 10; variable2 = 5; variable3='Divided By'">
{{variable1}} {{variable3}} {{variable2}}: {{variable1/variable2}}
</div>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<!-- AngularJS 1.4.8 !-->
<script src="../src/angular.min.js"></script>
</head>
<body ng-app>
<div ng-init="variable = 5">
This is my variable: {{variable}}<br/>
And my variable * 3 is:<span ng-bind="variable*3"></span>
</div>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<!-- AngularJS 1.4.8 !-->
<script src="../src/angular.min.js"></script>
</head>
<body ng-app>
<div ng-init="variable= ['http://','blog','allii','ir']">
My weblog url {{variable[0]}}{{variable[1]}}.{{variable[2]}}.{{variable[3]}} as array: {{variable}}
</div>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<!-- AngularJS 1.4.8 !-->
<script src="../src/angular.min.js"></script>
</head>
<body ng-app>
<div ng-init="variable= {firstNumber: 10, secondNumber: 5, divideText: 'Divided By'}">
{{variable.firstNumber}} {{variable.divideText}} {{variable.secondNumber}}: {{variable.firstNumber/variable.secondNumber}}
</div>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<!-- AngularJS 1.4.8 !-->
<script src="../src/angular.min.js"></script>
</head>
<body ng-app>
<div >
Are there just <span ng-bind="1+1"></span> Oranges, or {{1+2}} Apples?
</div>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<!-- AngularJS 1.4.8 !-->
<script src="../src/angular.min.js"></script>
</head>
<body ng-app>
<div id="form_wrapper" ng-init="notSubmitted = true">
<form ng-show="notSubmitted">
<input type="text" name="feedback"/>
<input type="submit" value="Submit Feedback"/>
</form>
<div ng-hide="notSubmitted">Thanks for submitting your feedback!</div>
</div>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.8/angular.min.js"></script>
</head>
<body ng-app>
<!-- All Examples Code In This Section Added Here!-->
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<!-- AngularJS 1.4.8 !-->
<script src="../src/angular.min.js"></script>
</head>
<body ng-app>
<div id="form_wrapper" ng-init="notSubmitted = true">
<form ng-show="notSubmitted">
<input type="text" name="feedback"/>
<input type="submit" value="Submit Feedback" ng-click="notSubmitted = !notSubmitted"/>
</form>
<div ng-hide="notSubmitted">Thanks for submitting your feedback!</div>
</div>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<!-- AngularJS 1.4.8 !-->
<script src="../src/angular.min.js"></script>
</head>
<body ng-app>
<input type="checkbox" ng-init="checkboxInput = 'Checked'" ng-model="checkboxInput"
ng-true-value="'Checked'" ng-false-value="'not Checked'">
My input is "<span ng-bind="checkboxInput"></span>". Change it!
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<!-- AngularJS 1.4.8 !-->
<script src="../src/angular.min.js"></script>
</head>
<body ng-app>
<input type="checkbox" ng-init="checkboxInput = true" ng-model="checkboxInput">
My input is checked: "<span ng-bind="checkboxInput"></span>". Change it!
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<!-- AngularJS 1.4.8 !-->
<script src="../src/angular.min.js"></script>
</head>
<body ng-app>
<input type="text" ng-init="textInput = 'Initial'" ng-model="textInput">
My input value is "<span ng-bind="textInput"></span>". Type something!
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<!-- AngularJS 1.4.8 !-->
<script src="../src/angular.min.js"></script>
</head>
<body ng-app>
<div ng-init="radioButton = 'Happy'">
<input type="radio" value="Happy" ng-model="radioButton"/> Happy
<input type="radio" value="Angry" ng-model="radioButton"/> Angry
<input type="radio" value="Sad" ng-model="radioButton"/> Sad
You are "<span ng-bind="radioButton"></span>", not?. Please Select!
</div>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<!-- AngularJS 1.4.8 !-->
<script src="../src/angular.min.js"></script>
</head>
<body ng-app>
<select ng-init="selectOption = 'Happy'" ng-model="selectOption">
<option value="Happy">Happy</option>
<option value="Angry">Angry</option>
<option value="Sad" selected>Sad</option>
</select>
You are "<span ng-bind="selectOption"></span>", not?. Please Select!
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<!-- AngularJS 1.4.8 !-->
<script src="../src/angular.min.js"></script>
</head>
<body ng-app>
<input type="text" ng-model="textInput">
My input value is "<span ng-bind="textInput"></span>". Type something!
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.