Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
angular2to1
Advanced tools
An angular 2 to angular 1 shim tool to start writing angular 2 component syntax with angular 1
An angular 2 to angular 1 Shim - Write angular 2 components with angular 1.
As explained in my blog post: Write Angular 2 Components In Angular 1.
via npm:
npm i angular2to1 --save-dev
in browser, include the dist/angular2to1.min.js
(or ./index.js
)
An angular 2 to angular 1 function. This function should provide ES5 syntax of angular v2 to be used with angular 1 reasons:
This code eventually defines an angular.js version 1.x module, directive and controller:
var myApp = ng.core
.Component({
selector: 'my-app'
providers: [
'core.services'
],
bindings: {
title: '@'
}
})
.View({
template: '<div> {{ myApp.title }} </div>'
})
.Class({
constructor: 'MyAppCtrl'
})
Consume the new module in your and include it:
angular.module('app', [
'my-app'
])
// or if you're using commonjs
angular.module('app', [
require('my-app').name
])
Simply, use the module in html:
<my-app title="my-player"></my-app>
<my-app></my-app>
- defined as 'my-app'
<div tooltip></div>
- defined as '[tooltip]'
use npm:
npm install angular2to1 --save
FAQs
An angular 2 to angular 1 shim tool to start writing angular 2 component syntax with angular 1
The npm package angular2to1 receives a total of 0 weekly downloads. As such, angular2to1 popularity was classified as not popular.
We found that angular2to1 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
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.