Vote count:
0
i try to make one page site. so my main page is never refreshed but contents will be changed.
here is my main page
<button id="click"></button>
<div id="main">
<page1></page1>
</div>
all contents from directive page1.
but i want to change inner contents using exist directive called 'page2' (page1 -> page2)
so if i click button#click , div#main's contents will be changed
.controller( 'MyCtrl', function MyCtrl( $scope ) {
$scope.showTask = function(){
var main = angular.element(document.querySelector('#main'));
};
})
.directive('page1', [function () {
return {
restrict: 'E',
transclude: true,
templateUrl: page1.html,
replace: true
};
}])
.directive('page2', [function () {
return {
restrict: 'E',
transclude: true,
templateUrl: page2.html,
replace: true
};
}])
but i can't find a solution how to change directive (page1 -> page2) please help me.
asked 3 mins ago
how to change directive in angular js
Aucun commentaire:
Enregistrer un commentaire