iRek
Script Execution Specialist
LEVEL 1
200 XP
In this article we will create Simple Data Binding using AngularJS. The code will automatoically display the input details in the page. To learn more about this, just follow the steps below.
Getting started:
First you will need to download & install the AngularJS here's the link https://angularjs.org/.
And this is the link for the bootstrap that i used for the layout design https://getbootstrap.com/.
Creating the Main Interface
This code contains the interface of the application. This code will render application and display the form. To do that just kindly write these block of code inside the text editor and save this as index.html.
Creating the Main Function
This code contains the main function of the application. The code will dynamically display the inputted details. To that just kindly copy and write these block of codes inside the text editor, then save it inside the js folder as script.js
There you have it we successfully created a Simple Data Binding using AngularJS. I hope that this very simple tutorial help you to what you are looking for. For more updates and tutorials just kindly visit this site. Enjoy Coding!!
Download
Getting started:
First you will need to download & install the AngularJS here's the link https://angularjs.org/.
And this is the link for the bootstrap that i used for the layout design https://getbootstrap.com/.
Creating the Main Interface
This code contains the interface of the application. This code will render application and display the form. To do that just kindly write these block of code inside the text editor and save this as index.html.
- <!DOCTYPE html>
- <html
lang
=
"en"
>
- <head
>
- <meta
charset
=
"UTF-8"
name
=
"viewport"
content
=
"width=device-width, initial-scale=1"
/
>
- <link
rel
=
"stylesheet"
type
=
"text/css"
href
=
"css/bootstrap.css"
/
>
- <script
src
=
"js/angular.js"
></
script
>
- <script
src
=
"js/script.js"
></
script
>
- </
head
>
- <body
ng-app=
"myModule"
>
- <nav class
=
"navbar navbar-default"
>
- <div
class
=
"container-fluid"
>
- <a
class
=
"navbar-brand"
href
=
"https://www.sourcecodester.com"
>
Sourcecodester</
a
>
- </
div
>
- </
nav>
- <div
class
=
"col-md-3"
></
div
>
- <div
class
=
"col-md-6 well"
ng-controller =
"myController"
>
- <h3
class
=
"text-primary"
>
Simple Data Binding Using AngularJS</
h3
>
- <hr
style
=
"border-top:1px dotted #000;"
/
>
- <div
class
=
"col-md-4"
>
- <textarea
class
=
"form-control"
style
=
"resize:none;"
ng-model=
"result"
></
textarea
>
- </
div
>
- <div
class
=
"col-md-6"
>
- <div
style
=
"float:left; margin:10px;"
>
{{result}}</
div
>
- </
div
>
- </
div
>
- </
body
>
- </
html
>
Creating the Main Function
This code contains the main function of the application. The code will dynamically display the inputted details. To that just kindly copy and write these block of codes inside the text editor, then save it inside the js folder as script.js
- var
myApp =
angular.module
(
"myModule"
,
[
]
)
- .controller
(
"myController"
,
function
(
$scope)
{
- }
)
;
There you have it we successfully created a Simple Data Binding using AngularJS. I hope that this very simple tutorial help you to what you are looking for. For more updates and tutorials just kindly visit this site. Enjoy Coding!!
Download
You must upgrade your account or reply in the thread to view the hidden content.