-2

enter image description hereI wrote an app in AngularJS two years ago. It was my first stab at AngularJS in a coding bootcamp. I haven't coded much in 2-years. I never hosted the app. It was working as intended the last time I used it. I opened it up today in Chrome and it no longer works. I'm getting a bunch of errors in the console. Is it possible to fix it and get it running again or do I need to start over with the newest version of AngularJS?

The eroor I am gettin in colnsole.

  • I'm sure it's possible - unfortunately, you need to provide the actual code. – tymeJV Mar 07 '17 at 22:03
  • What Errors are you getting? – Janatbek Orozaly Mar 07 '17 at 22:03
  • **Describe the problem.** "It doesn't work" is not a problem statement. Tell us what the expected behavior should be. Tell us what the exact wording of the error message is, and which line of code is producing it. Put a brief summary of the problem in the title of your question – georgeawg Mar 07 '17 at 22:03
  • Post some of your code, esp. the HTML used to pull in Angular and your other dependent libraries. – photoionized Mar 07 '17 at 22:03
  • Read [AngularJS Developer Guide - Migrating from Previous Version](https://docs.angularjs.org/guide/migration). – georgeawg Mar 07 '17 at 22:10
  • @photoionized Excuse my ignorance. I haven't coded in a long time and I'm new to stackoverflow. Is there a way for me to share my code? It is on github here github.com/rockygibson/salesApp. Let me know if you can access it and run it so you can see the errors I'm getting. Or if there is a better way to do this. – Rocky Gibson Mar 07 '17 at 23:25
  • @JanatbekSharsheyev Excuse my ignorance. I haven't coded in a long time and I'm new to stackoverflow. Is there a way for me to share my code? It is on github here github.com/rockygibson/salesApp. Let me know if you can access it and run it so you can see the errors I'm getting. Or if there is a better way to do this. – Rocky Gibson Mar 07 '17 at 23:26
  • @tymeJV github.com/rockygibson/salesApp – Rocky Gibson Mar 07 '17 at 23:27
  • you can use jsfiddle and select angular as library put your code and run it there. It mightbe because of some functionality are being deprecated since your last time coded that. – Janatbek Orozaly Mar 07 '17 at 23:30
  • @georgeawg What if I wrote it in 1.3 and just want it to work as it did in 1.3. e.g. I don't see an option on that resource page to go from 1.3 to 1.5 – Rocky Gibson Mar 07 '17 at 23:33
  • To migrate from 1.3 to 1.5, review all the breaking changes for **both** 1.4 and 1.5. – georgeawg Mar 08 '17 at 01:53

1 Answers1

-1

Your problem was:

  • 1.your links to libraries were in body and not in header.
  • 2.all your links were missing https:
  • 3.You might running from file and not in local server.

Problem Solved:

  • I run it in localhost Apache server.
  • I changed all your links with https: included
  • I removed all links inside header

Below is your new index.html file. Copy and paste this new code and run in local server.

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

    <head>
    <title>workMe</title>
      <link rel="stylesheet" type="text/css" href="https://ajax.googleapis.com/ajax/libs/angular_material/0.8.2/angular-material.min.css">
       <!-- Latest compiled and minified CSS -->
      <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
      <link rel="stylesheet" type="text/css" href="style.css">
      <!-- Angular-->
       <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.6/angular.min.js"></script>
      <script src="https://code.angularjs.org/1.4.0-beta.5/angular-route.min.js"></script>
       <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.6/angular-animate.min.js"></script>
       <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.5/angular-aria.min.js"></script>

       <!--Material-->
       <script src="https://ajax.googleapis.com/ajax/libs/angular_material/0.8.2/angular-material.min.js"></script>


       <!-- Firebase -->
    <script src="https://cdn.firebase.com/js/client/2.2.2/firebase.js"></script>

      <!-- AngularFire -->
        <script src="https://cdn.firebase.com/libs/angularfire/1.0.0/angularfire.min.js"></script>

    <script src="js/app.js"></script>
    <script src="js/NewOpp/newOppCtrl.js"></script>
    <script src="js/OppService.js"></script>
    </head>



       <body>
        <header class="header">workMe</header>
        <div ng-view class="background"></div>



    </body>

     </html>

Look at the result. and console with no errors page with result

Janatbek Orozaly
  • 445
  • 3
  • 17
  • Glad it helped. – Janatbek Orozaly Mar 08 '17 at 01:24
  • So, just for the sake of learning, neither the links being in the body of your page, nor your urls not starting with https are the problem. The issue is with how protocol relative urls are being resolved in whatever you're viewing your page with (see https://en.wikipedia.org/wiki/Uniform_Resource_Locator#prurl). If you were opening up the page as a file, the urls are going to be looking for resources with the `file://` protocol. That's why changing the urls to use https works, if you were serving this static file over https it would've just worked out of the box. – photoionized Mar 08 '17 at 01:58
  • I don't use angular at all. I just saw errors in console that it couldn't find your links to angular. you can avoid using https if you have downloaded angular into your project folder and link to them via path to that directory in your project. – Janatbek Orozaly Mar 08 '17 at 02:09
  • I also got downvote for my answer. Could someone explain why? where I was wrong? – Janatbek Orozaly Mar 08 '17 at 02:15
  • Read also this post: http://stackoverflow.com/questions/15677882/angularjs-routing-without-a-web-server – Janatbek Orozaly Mar 08 '17 at 02:22
  • @JanatbekSharsheyev I setup Apache as the localhost... After setting up the local server, the application is working correctly but when I make updates to my newOpp.html file, specifically changing the placeholder in to “Account Name” instead, I save my changes in sublime text and refresh in the browser but the placeholder doesn’t update, any suggestions? – Rocky Gibson Mar 08 '17 at 05:05