0
у меня есть эта ошибкаугловой ngRoute Js TypeError: Не удается прочитать свойство 'ID_of_element' неопределенной
angular.js:13920 TypeError: Cannot read property '103' of undefined
103 является ID моего элемента
и мой код app.js
var app = angular.module('myApp',['ngRoute','ngAnimate']);
app.config(function($routeProvider) {
$routeProvider
.when("/", {
templateUrl : "home.html"
}).
when("/quatre/:id",{
templateUrl:'quatre.html',controller:'ViewIdInformation'}).
when("/404", {
templateUrl : "404.html"
})
.otherwise({
redirectTo:'/404'
});
});
app.controller('ViewIdInformation',['$scope','$routeParams',function($scope,$routeParams){
$scope.x = $scope.myWelcome[$routeParams.id];
}]);
и код моей страницы quatre.html, как это
{{x.id}}
, но у меня такая же проблема, пожалуйста, любая помощь.
Ваш '$ scope.myWelcome' не определен. '$ routeParams.id' похоже на значение' 103'. Кольцо колокольчиков? – Paritosh