Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
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
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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.