I am using angular js - ui.router concept for SinglePageApplication Development.
When i click Page 1 and Page 2 link, then its respective html page will be rendered into 'ui-view' div. I want to add 'data-ng-blur' attribute into respective html page(Sample.html, Sample2.html), input controls while click 'ui-sref' link. I have give Document ready events in
that both htmls, But that's not fired. So there is any option for add attributes for input elements in loading html before its respective Controller called by ui-router.
Code :
<div data-ng-app="ProjectApp">
<div class="menulist">
<li><a ui-sref="pageone">Page 1</a></li>
<li><a ui-sref="pagetwo">Page 2</a></li>
</div>
<div class="ui-view"></div>
<script>
var loApp = angular.module("ProjectApp", ["ui.router"]);
loApp.config(function ($urlRouterProvider, $stateProvider, $urlMatcherFactoryProvider) {
$urlMatcherFactoryProvider.caseInsenstiveMatch = true;
$stateProvider
.state('pageone', {
url: '/Screen-one',
templateUrl: 'Sample.html',
controller: pageoneCtrler
})
.state('pagetwo', {
url: '/Screen-two',
templateUrl: 'Sample2.html',
controller: pagetwoCtrler
});
});
loApp.controller("pageoneCtrler", function ($scope) {
$scope.myfunction = function(){
}
});
loApp.controller("pagetwoCtrler", function ($scope) {
});
</script>
</div>
What I have tried:
I tried to give document ready events in that htmls(Sample.html, Sample2.html), but its not fired when html loading in ui-view div.