I start with Angular and just understand the AngularUI Router perspective. I have one html page that contains a list of questions (each question needs its own URL) and a results page.
I created a quick stripped-down plunker (with all files) to demonstrate the problem:
http://plnkr.co/edit/QErnkddmWB0JgendbOiV?p=preview
For SO ref:
app.js
angular.module('foo', ['ui.router']) .config(function($stateProvider, $urlRouterProvider) { $urlRouterProvider.otherwise('/q1'); $stateProvider .state('question', { url: '/:questionID', templateUrl: 'questions.html', controller: 'questionsCtrl' }) .state('results', { url: '/results', templateUrl: 'results.html' }) }) .controller('questionsCtrl', function($scope, $stateParams) { $scope.questionID = $stateParams.questionID; $scope.scotches = [ { name: 'Macallan 12', price: 50 }, { name: 'Chivas Regal Royal Salute', price: 10000 } ]; });
Basically, for some unknown reason (to me), I have to double-click the " results " link, so that it appears in my eyes, it should appear on the first click.
Does anyone know why this is happening?
but.
javascript angularjs angular-ui-router angular-ui
Adi
source share