mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
21 lines
741 B
JavaScript
21 lines
741 B
JavaScript
angular.module('listExample.controllers', [])
|
|
|
|
|
|
// Controller that fetches a list of data
|
|
.controller('MovieIndexCtrl', function($scope, MovieService) {
|
|
|
|
// "MovieService" is a service returning mock data (services.js)
|
|
// the returned data from the service is placed into this
|
|
// controller's scope so the template can render the data
|
|
$scope.movies = MovieService.all();
|
|
|
|
$scope.title = "Completely Random Collection Of Movies";
|
|
})
|
|
|
|
// Controller that shows more detailed info about a movie
|
|
.controller('MovieDetailCtrl', function($scope, $routeParams, MovieService) {
|
|
// "MovieService" is a service returning mock data (services.js)
|
|
$scope.movie = MovieService.get($routeParams.movieId);
|
|
$scope.title = "Movie Info";
|
|
});
|