Hi,
I am using angularjs with dependences at ui.bootstrap and ngRoute.
I wanna translate every page by my own controller. Each page will has own
cotroller for.... Translation will be run after i click on radio button in
index.html.
It worked fine, until I didn´t move menu from index.html to homeView.html
and called controller into routeProvider. Now, it will call ButtonsCtr
(controller) once, when page is reloade and after that, if i click on
radio button nothing happen (description of button didn´t change from XXX
to YYY).
(I wanna have main menu just at homeView)
Could you help me?
Thx
<script>
var mainApp = angular.module('mainApp', ['ui.bootstrap', 'ngRoute' ]);
mainApp.config(function ($routeProvider) {
$routeProvider.
when('/', {
templateUrl: 'App/home/homeView.html',
controller: 'ButtonsCtrl'
}).
when('/1st', {
templateUrl: 'App/components/welcome/welcomeView.html'
}).
.....
});
mainApp.controller('ButtonsCtrl', function ($scope) {
$scope.singleModel = 1;
$scope.radioModel = 'SK';
$scope.checkModel = {
SK: true,
ENG: false
};
$scope.opts =
[
{ eng: 'XXX', sk: 'YYY' },
{ eng: 'XXX', sk: 'YYY' },
{ eng: 'XXX, sk: 'YYY' },
{ eng: 'XXX', sk: 'YYY' }
];
});
</script>
<!-- index.html -- change language -->
<div class="btn-group">
<label class="btn btn-primary" ng-model="radioModel"
btn-radio="'SK'">SK</label>
<label class="btn btn-primary" ng-model="radioModel"
btn-radio="'ENG'">ENG</label>
</div>
<!--homeView.html -- main menu -->
<div id="menu">
<span ng-repeat="opt in opts"><a ng-href="#/{{opt.path}}"
class="menu-text">{{radioModel === "SK" ? opt.sk : opt.eng }}</a></span>
</div>
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.