tommyd456
tommyd456

Reputation: 10673

How to update Angular from 1.3 to 1.4

I would like to upgrade my Angular app from version 1.3 to 1.4 but I'm worried I might make a hash of it. Therefore, I wanted to ask this question first.

Here is my bower.json file:

{
  "name": "my app",
  "version": "0.0.1",
  "dependencies": {
    "angular": "~1.3.x",
    "angular-animate": "~1.3.x",
    "angular-resource": "~1.3.x",
    "angular-sanitize": "~1.3.x",
    "angular-ui-router": "~0.2.15",
    "jquery": "~2.1.1",
    "semantic-ui": "~2.0.0",
    "angular-elastic-input": "~2.0.1",
    "angular-sweetalert": "~1.0.4",
    "angular-marked": "~0.0.14",
    "angular-highlightjs": "~0.4.1",
    "angular-nanoscroller": "~0.2.1",
    "angular-gravatar": "~0.4.1",
    "angular-cookies": "~1.4.8" //this needs updated version of Angular
  },
  "resolutions": {
    "angular": "~1.3.x"
  }
}

Is it simple a case of changing the angular setting to ~1.4.x and running bower update or is there anything else I need to be aware of?

Upvotes: 1

Views: 3495

Answers (3)

Shashank Agrawal
Shashank Agrawal

Reputation: 25797

You can also do

bower install angular#1.4

Passing the --save flag to above command will also update it in the bower.json file.

Upvotes: 2

Ashish Ranjan
Ashish Ranjan

Reputation: 12960

bower install angular#1.4

and then persist or don't persist your changes in resolutions, or else you change your version in "dependencies" itself if you have decided to migrate, and then simply run:

bower install

Upvotes: 1

James Ives
James Ives

Reputation: 3355

Changing the version number from ~1.3.x to ~1.4.x in bower.json and then running bower update will do the trick.

Keep in mind though that when you update your packages that nothing is solely dependent on that specific version, otherwise you'll be asked to intervene during the installation. Running bower update by its self will attempt to update everything in your package, so if that's not what you want to do I suggest targeting angular specifically like Shahank suggested.

Upvotes: 0

Related Questions