pointer to array of integers

Furthermore:

AngularJS – how to dynamically add HTML and bind to controller

reference: http://stackoverflow.com/questions/19845950/angularjs-how-to-dynamically-add-html-and-bind-to-controller

index.html:

app.js:

Bind Angular JS to newly created html dynamically using Directive

Example 1

index.html:

app.js:

template.html:

Example 2

index.html:

app.js:

template.html:

text.htm:

Applying Angular JS to your HTML file

First, let’s create a basica index.html page and let’s include the angular js library in the head section:

Make sure you include that js file into your index.html. It assumes that the login.js file is in the same directory as your index.html:

Make sure we assign a controller name an app name. We need to put it higher in the DOM hierarchy because our scope controls whatever data is being used below. Therefore, for this example, let’s just use it in the body.

This means that whatever DOM is within our body tag will be able bound to Angular JS.

Then make our controller login.js file. Get have Angular return us an object variable that represents our app with the name we’ve given in ng-app. Then we can create our first controller. Make sure the name matches ng-controller.

Your basic angular framework is now set.

Full Code

index.html:

login.js: