Advertisement
Guest User

Untitled

a guest
Apr 3rd, 2019
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. movieApp.controller('movieController', function($scope, $http) {
  2.  
  3. $scope.userName = "admin";
  4. $scope.myFunc = function(userName, passWord) {
  5. if(userName == "admin" && passWord == "admin") {
  6. window.location.href = "#!viewMovies";
  7.  
  8. } else {
  9. window.location.href = "#!error";
  10. }
  11.  
  12. }
  13.  
  14. });
  15. movieApp.config(function($routeProvider) {
  16. $routeProvider
  17. .when("/error", {
  18. templateUrl : "error.html"
  19. })
  20. .when("/viewMovies", {
  21. templateUrl : "viewMovies.html",
  22. controller : "ViewMoviesController"
  23. })
  24. .otherwise({
  25. redirectTo: "home.html"
  26. });
  27. });
  28.  
  29. movieApp.controller("ViewMoviesController", function ($scope,$http) {
  30. $http.get("movieCollection.json").then(function (response) {
  31. $scope.myData = response.data.movieList;
  32. });
  33. $scope.msg = "This app allows you to keep track of your favorite movies!";
  34. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement