0

I have an application that uses AngularJS v1.2.12 but we aren't the people that created. I've searched everywhere how to upgrade v1.2.12 to v1.7.0 but it seems that in installed in a different way. All I've seen is "update bower.json file" or "update package.json file" but the angular folders are in "app\libs\frameworks\angular" and doesn't has any of those files... So I don't know if I should change the version manually or run some commands, but I've installed NodeJS and Angular CLI and it throws the same error when I try "ng -update" it says that it wasn't found the package.json file.

Even in the official page I didn't found anything.

Do you have any clue about this?


I've a ViewBag.IsDebug == false that use a XXXFramework.js that seems to be inner of the solution, but in case is ViewBag.IsDebug == true it uses

<script src="app/libs/frameworks/angular/angular.min.js"></script> 
<script src="app/libs/frameworks/angular/angular-animate.js"></script> 
<script src="app/libs/frameworks/angular/angular-cookies.min.js"></script> 
<script src="app/libs/frameworks/angular/angular-route.min.js"></script> 
<script src="app/libs/frameworks/moment/angular-moment.js"></script>
georgeawg
  • 48,608
  • 13
  • 72
  • 95
MattDmc
  • 27
  • 6
  • 1
    What does index.html look like? Does it have angular lib in it's own script tag perhaps? Anything built with `1.2` long precedes existence of Angular CLI and more likely used grunt or gulp as task runner if it wasn't just built manually – charlietfl Apr 03 '19 at 18:52
  • 1
    If it was built using grunt or gulp good chance you'll see injection comments in index file also – charlietfl Apr 03 '19 at 18:58
  • I've a ViewBag.IsDebug == false that use a XXXFramework.js that seems to be inner of the solution, but in case is ViewBag.IsDebug == true it uses – MattDmc Apr 03 '19 at 20:45
  • 1
    `ViewBag` sounds like an ASP .Net thing. You could use CDN versions of the files shown though and upgrade that way. https://code.angularjs.org/ – charlietfl Apr 03 '19 at 20:50
  • How can I use CDN versions? I mean, I download and replace them in my project folder? – MattDmc Apr 03 '19 at 21:38
  • 1
    That or use the remote CDN url directly in those script tags. One benefit of cdn versions is many users may already have them cached – charlietfl Apr 03 '19 at 21:41

1 Answers1

1
<script src="//unpkg.com/angular/angular.min.js"></script> 
<script src="//unpkg.com/angular-animate/angular-animate.js"></script> 
<script src="//unpkg.com/angular-cookies/angular-cookies.min.js"></script> 
<script src="//unpkg.com/angular-route/angular-route.min.js"></script> 
<script src="//unpkg.com/angular-moment/angular-moment.js"></script>

Also be sure to read AngularJS Developer Guide - Migrating from Previous Versions.

Also


In the meantime i'm trying to start using angularjs 1.3

In that case use:

<script src="//unpkg.com/angular@1.3/angular.js"></script> 
<script src="//unpkg.com/angular-animate@1.3/angular-animate.js"></script> 
<script src="//unpkg.com/angular-cookies@1.3/angular-cookies.js"></script> 
<script src="//unpkg.com/angular-route@1.3/angular-route.js"></script> 
<script src="//unpkg.com/angular-moment/angular-moment.js"></script> 

Also use angular.js instead of angular.min.js. It will enable Data Debug and provide better error messages.

georgeawg
  • 48,608
  • 13
  • 72
  • 95
  • 1
    Ooh yeah....numerous things going to break in big jump from 1.2 to latest – charlietfl Apr 03 '19 at 21:02
  • Yes I've read it before but only says what functions are deprecated and what are the updates of each new version. It doesn't has any data of what are the steps to follow to update it. Even using NuGet, when I install the new version 1.7.0 it installed at Project level, not in the app/libs/framework path I said before – MattDmc Apr 03 '19 at 21:22
  • 1
    @MattDmc one thing that will almost certainly need fixing is the `$http` API deprecated `success` and `error` methods a long time ago in favor of promise `then()` and `catch()` – charlietfl Apr 03 '19 at 21:45
  • Ok, I will keep that in mind whenever I can update it. In the meantime i'm trying to start using angularjs 1.3 or something like that – MattDmc Apr 04 '19 at 12:38
  • Well something weird happened, when I add the " – MattDmc Apr 08 '19 at 12:31