PMListController.$inject=['$scope'];functionPMListController($scope){$scope.pokemons=pokemons;$scope.remove=function(index){$scope.pokemons.splice(index,1);}}PMDetailController.$inject=['$scope','$routeParams'];functionPMDetailController($scope,$routeParams){} 接下来编写路由配置,明确一下路由...
("./pages/Pokemon")); function App() { return ( <BrowserRouter> <Route path="/" exact component={Pokedex} /> <Route path="/pokedex" exact component={Pokedex} /> <Route path="/pokemon/:pokemonIndex" exact component={Pokemon} /> </BrowserRouter> ); }Example #13Source File: ...
PMListController.$inject = ['$scope']; function PMListController ($scope) { $scope.pokemons = pokemons; $scope.remove = function (index) { $scope.pokemons.splice(index, 1); } } PMDetailController.$inject = ['$scope', '$routeParams']; function PMDetailController ($scope, $routeParam...