logo
down
shadow

How to downgrade an Angular Project?


How to downgrade an Angular Project?

By : L Allen
Date : November 25 2020, 01:01 AM
around this issue You need to thoroughly check which functionality angular had made obsolete and then you have to made changes in your code accordingly. Unfortunately there is no command for it :).
code :


Share : facebook icon twitter icon
Downgrade angular from 4 to 2

Downgrade angular from 4 to 2


By : Sitanath Mandal
Date : March 29 2020, 07:55 AM
To fix the issue you can do As @Daniel Ormeño stated in the comments
You can manually edit the dependencies like this:
code :
"dependencies": {
    "@angular/common": "~2.4.1",
    "@angular/compiler": "~2.4.1",
    "@angular/compiler-cli": "^2.4.1",
    "@angular/core": "~2.4.1",
    "@angular/forms": "~2.4.1",
    "@angular/http": "~2.4.1",
    "@angular/platform-browser": "~2.4.1",
    "@angular/platform-browser-dynamic": "~2.4.1",
    "@angular/platform-server": "^2.4.1",
    "@angular/router": "~3.4.0",
    "core-js": "^2.4.1",
    "reflect-metadata": "^0.1.8",
    "rxjs": "^5.0.2",
    "systemjs": "0.19.40",
    "zone.js": "^0.7.4"
},
Downgrade angularcli from @angular/cli@latest to angular-cli@1.0.0-beta.24 getting error

Downgrade angularcli from @angular/cli@latest to angular-cli@1.0.0-beta.24 getting error


By : gjjones
Date : March 29 2020, 07:55 AM
like below fixes the issue Cheers... :)
I got the solution for the problem for angular-cli@1.0.0-beta.24 Peer dependencies are missing so the cli was not getting installed sometimes it was giving npm error as package.json is missing for angular-cli@1.0.0-beta.24
elegant way to downgrade all angular components for angular js

elegant way to downgrade all angular components for angular js


By : user2462639
Date : March 29 2020, 07:55 AM
may help you . If the goal is to get rid of boilerplate code, you can get list of components to upgrade, get the selector name for each component and register corresponding directive
code :
function getComponents() {
  // depends on how your components are organized
  // for example, iterate over require.context(".", true, /\.component.ts$/);
  // or return fixed array
  return [ColorPickerComponent, FileSelectComponent];
}
function getComponentSelector(component) {
  // if you don't need AOT
  return toCamelCase(component.__annotations__[0].selector);

  // if you do need it
  let name: string = component.name;
  const suffix = 'Component';
  if (name.endsWith(suffix)) {
    name = name.substr(0, name.length - suffix.length);
  }
  return uncapitalize(name);
}

function toCamelCase(selector: string) {
  const splitted = selector.split('-');
  for (let i = 1; i < splitted.length; i++) {
    splitted[i] = capitalize(splitted[i]);
  }
  return splitted.join('');
}

function capitalize(name: string) {
  return name.charAt(0).toUpperCase() + name.slice(1);
}

function uncapitalize(name: string) {
  return name.charAt(0).toLowerCase() + name.slice(1);
}
downgradeComponents(angular.module('kn-components'));

function downgradeComponents(module: ng.IModule) {
  const components = getComponents();
  for (const component of components) {
    const selector = getComponentSelector(component);
    module.directive(selector, downgradeComponent({ component }));
  }
}
I want to downgrade Angular CLI globally as my project is using older version of it

I want to downgrade Angular CLI globally as my project is using older version of it


By : Sravan Kumar
Date : March 29 2020, 07:55 AM
I wish this helpful for you You can downgrade your global angular-cli installation to eg. 1.0.0-beta.14 by issuing:
Angular 2 Downgrade Component with Output Parameter to Angular 1

Angular 2 Downgrade Component with Output Parameter to Angular 1


By : Tania
Date : March 29 2020, 07:55 AM
help you fix your problem I found a solution for my problem as follows:
define my components inputs and ouputs:
code :
directive('downgradeEmployeeSelector', downgradeComponent({
        component: EmployeeSelectorComponent,    
        inputs: ['selectedEmployeesIds', 'multiSelect', 'required'],
        outputs: ['isValid', 'selectedEmployeesIdsChange']
      })
<downgrade-employee-selector name="empSelector" [selected-employees-ids]="vm.selectedEmployeeIds" [required]="true" (is-valid)="vm.validateEmployeeSelector($event)"></downgrade-employee-selector>
shadow
Privacy Policy - Terms - Contact Us © ourworld-yourmove.org