Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- movieApp.controller('movieController', function($scope, $http) {
- $scope.userName = "admin";
- $scope.myFunc = function(userName, passWord) {
- if(userName == "admin" && passWord == "admin") {
- window.location.href = "#!viewMovies";
- } else {
- window.location.href = "#!error";
- }
- }
- });
- movieApp.config(function($routeProvider) {
- $routeProvider
- .when("/error", {
- templateUrl : "error.html"
- })
- .when("/viewMovies", {
- templateUrl : "viewMovies.html",
- controller : "ViewMoviesController"
- })
- .otherwise({
- redirectTo: "home.html"
- });
- });
- movieApp.controller("ViewMoviesController", function ($scope,$http) {
- $http.get("movieCollection.json").then(function (response) {
- $scope.myData = response.data.movieList;
- });
- $scope.msg = "This app allows you to keep track of your favorite movies!";
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement