DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workkloads.

Secure your stack and shape the future! Help dev teams across the globe navigate their software supply chain security challenges.

Releasing software shouldn't be stressful or risky. Learn how to leverage progressive delivery techniques to ensure safer deployments.

Avoid machine learning mistakes and boost model performance! Discover key ML patterns, anti-patterns, data strategies, and more.

Related

  • Rediscovering Angular: Modern Advantages and Technical Stack
  • Angular Input/Output Signals: The New Component Communication
  • Azure Deployment Using FileZilla
  • Angular RxJS Unleashed: Supercharge Your App With Reactive Operators

Trending

  • Enhancing Security With ZTNA in Hybrid and Multi-Cloud Deployments
  • Fixing Common Oracle Database Problems
  • Stateless vs Stateful Stream Processing With Kafka Streams and Apache Flink
  • Performance Optimization Techniques for Snowflake on AWS
  1. DZone
  2. Coding
  3. Frameworks
  4. Upgrade to Angular 7 in 5 Simple Steps

Upgrade to Angular 7 in 5 Simple Steps

Now that Angular has committed to bi-annual upgrades, knowing the steps involved in taking your app from one version to the next is a must.

By 
Rudar Daman Singla user avatar
Rudar Daman Singla
·
Nov. 15, 18 · Tutorial
Likes (4)
Comment
Save
Tweet
Share
194.3K Views

Join the DZone community and get the full member experience.

Join For Free

Angular helps to build modern applications for web, mobile, or desktop. Currently, Angular 7 is the latest version. Staying up-to-date with the latest version is very important. Upgrading to Angular 7 takes just a few simple steps:

  1. First, upgrade the Angular version globally by adding the latest version via the terminal: sudo npm install -g @angular/cli@latest
  2. Upgrade the version locally in your project and make sure the changes for the new version are reflected in the package.json fileng update @angular/cli
  3. Upgrade all your dependencies and dev dependencies in package.json
    1. Dependencies:
      1. npm install --save @angular/animations@latest @angular/cdk@latest @angular/common@latest @angular/compiler@latest @angular/core@latest @angular/flex-layout@latest @angular/forms@latest @angular/http@latest @angular/material@latest @angular/platform-browser@latest @angular/platform-browser-dynamic@latest @angular/router@latest core-js@latest zone.js@latest rxjs@latest rxjs-compat@latest
    2. Dev Dependencies:
      1. npm install --save-dev @angular-devkit/build-angular@latest @angular/compiler-cli@latest @angular/language-service @types/jasmine@latest @types/node@latest codelyzer@latest karma@latest karma-chrome-launcher@latest karma-cli@latest karma-jasmine@latest karma-jasmine-html-reporter@latest jasmine-core@latest jasmine-spec-reporter@latest protractor@latest tslint@latest rxjs-tslint@latest webpack@latest
    3. Angular-devkit was introduced in Angular 6 to build Angular applications that required dependency on your CLI projects.
    4. Also, you'll need to upgrade the version for Typescriptnpm install typescript@2.9.2 --save-dev
  4. Now, migrate the configuration of angular-cli.json to angular.jsonng update @angular/cli
    ng update @angular/core
    If Angular material is used, use this command:ng update @angular/material
  5. Remove deprecated RxJS 6 features npm install -g rxjs-tslint
      rxjs-5-to-6-migrate -p src/tsconfig.app.json
    (Please, be patient and wait until the execution completes).
  6. Now, uninstall rxjs-compat as it is an unnecessary dependency for Angular 7.npm uninstall --save rxjs-compat
  7. Also changeimport { Observable } from 'rxjs/Observable';
     toimport { Observable } from 'rxjs';

Finally, start your Angular 7 application using ng serve.

A Few Important Points

  • Create a file browserlist without any extension in the src directory and add the below lines to it. This file is currently used by auto-prefixer to adjust CSS to support the below specified browsers. For additional information regarding the format and rule options, please see: https://github.com/browserslist/browserslist
  • For IE 9 through 11 support, please remove 'not' from the last line of the file and adjust as needed.
  • If you want detailed errors from zone.js, then add import 'zone.js/dist/zone-error';
    to top of the enviornment.ts file inside the environment directory.
  • Move the karma.conf.js file to the src directory.
  • Move the protractor.conf.js file to the e2e directory.
  • Switch from HttpModule -> HttpClientModule
    HttpService -> HttpClientService

I hope this article helps you to upgrade your Angular application to Angular 7. For any other queries, visit angular official documentation for upgrade by clicking here.


If you enjoyed this article and want to learn more about Angular, check out our compendium of tutorials and articles from JS to 8.

AngularJS

Opinions expressed by DZone contributors are their own.

Related

  • Rediscovering Angular: Modern Advantages and Technical Stack
  • Angular Input/Output Signals: The New Component Communication
  • Azure Deployment Using FileZilla
  • Angular RxJS Unleashed: Supercharge Your App With Reactive Operators

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!