Why doesn't angular load in this plnkr?

105 Views Asked by At

I have researched my issue and tried many solutions but have not solved it.

For some reason angular does not seem to be loading in plunker.

I have head iffy are no longer supported in later version in angular, but I have tried loading an older version and still does not work.

Any ideas on how I can get this running?

Here is the link:

http://plnkr.co/edit/rrnzNjze2QqkWtjvNUNH?p=preview

HTML

<!DOCTYPE html>
<html ng-app="githubViewer">

  <head>
    <script data-require="angular.js@*" data-semver="1.1.0" src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.1.0/angular-bootstrap-prettify.js"></script>
    <link rel="stylesheet" href="style.css" />
    <script src="script.js"></script>
  </head>

  <body ng-controller="MainController">
    <h1>{{message}}</h1>
    <div> 
      {{ error }}
    </div>
    <div>
      <div>
        Name: {{user.name}}
      </div>
      <div>
        Location: {{user.location}}
      </div>
      <div>
        <img ng-src="{{user.avatar_url}}" title="{{user.name}}" />
      </div>
    </div>
  </body>

</html>

Javascript

// Code goes here

  var app = angular.module("githubViewer", []);

  var MainController = function($scope, $http) {

  var onUserComplete = function(response){
    $scope.user = response.data;
  };

  var onError = function(reason){
    $scope.error = "Could not fetch the user request!";
  };

  $http.get("https://api.github.com/users/robconery")
        .then(onUserComplete, onError);

  $scope.message = "Hello, Angular!";

};

  app.controller("MainController", ["$scope", "$http", MainController]);
1

There are 1 best solutions below

1
On BEST ANSWER

Replace angular-bootstrap-prettify.js (I don't know what is angular-bootstrap-prettify, do you really need it?) by angular.js and your plunkr works.