Sunday, 15 July 2012

javascript - Directive Angular JS -



javascript - Directive Angular JS -

have 3 html screens.

screen1.html:

<button id="screenbtn"></button>

screen2.html:

<div id="sctmpl"> <label>label screen two</label> </div>

screen3.html:

<div id="sctmpl1"> <label>label screen three</label> </div>

all these screens in different folders under same root.

so on click of button need toggle between screen2 , screen3, need accomplish using angular js.

as easy manipulate in jquery achieved, scenario accomplish in angular js.

can 1 please allow me know how accomplish basic demo.

sounds want utilize routeprovider.

angular.module('myapp', ['ngroute']).config(function($routeprovider) { homecoming $routeprovider.when('/screen1', { templateurl: 'screen1.html', controller: 'acontroller' }).when('/screen2', { templateurl: 'screen2.html', controller: 'bcontroller' }); }); <body> <ul> <li><a ng-href="#screen1">screen 1</a></li> <li><a ng-href="#screen2">screen 2</a></li> </ul> <div ng-view></div> </body>

i made working illustration here

keep in mind in order utilize ngroute need include in project.

javascript jquery html angularjs angularjs-directive

No comments:

Post a Comment