
Security News
Package Maintainers Call for Improvements to GitHub’s New npm Security Plan
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
ui-router-ng1-to-ng2-dstellini
Advanced tools
This module provides ngUpgrade support for UI-Router, allowing hybrid ng1/ng2 UI-Router apps.
Your app will be hosted on Angular 1 while you incrementally upgrade it to Angular 2. After configuring your app, you can use an Angular 2 Component as a view in your state definitions.
Once you route to a ng2 component, you can continue to use the ng2 directives (ui-view and uiSref) from ui-router-ng2. We do not yet support nesting an angular 1 directive inside an angular 2 ui-view. Because of this, apps should be migrated starting from leaf views up to the root state.
See example here.
Add "ui-router-ng1-to-ng2" to your package.json
dependencies: {
...
"ui-router-ng1-to-ng2": "^1.0.6"
}
ng-app
to using the ngUpgrade manual bootstrap// Create an upgrade adapter instance
import {UpgradeAdapter} from 'angular2/upgrade';
export const upgradeAdapter = new UpgradeAdapter();
// Supply ui-router-ng1-to-ng2 with the upgrade adapter
import {uiRouterNgUpgrade} from "ui-router-ng1-to-ng2";
uiRouterNgUpgrade.setUpgradeAdapter(upgradeAdapter);
// Manually bootstrap the app with the Upgrade Adapter (instead of ng-app)
// Add 'ui.router.upgrade' to your apps module depedencies
upgradeAdapter.bootstrap(document.body, ['myApp', 'ui.router.upgrade']);
Use component:
in your state declaration
var leaf = {
name: 'foo.bar.leaf',
url: '/leaf',
component: MyNg2CommponentClass
};
$stateProvider.state(leaf);
<html>
<body>
<ui-view></ui-view>
</body>
</html>
FAQs
### Hybrid Angular 1/Angular 2 UI-Router apps
We found that ui-router-ng1-to-ng2-dstellini demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.