Security News
New Python Packaging Proposal Aims to Solve Phantom Dependency Problem with SBOMs
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
angular-component
Advanced tools
Start using component()
now!
angular-component.js is a <1kb
script that adds component()
support in Angular 1.5 to all Angular versions above 1.3
, so you can begin using the new method now.
_Note: you must include this script straight after angular.js
and before your application code to ensure the component()
method has been added to the angular.module
global.
Read about the Angular 1.5
component()
method here
<div ng-app="app">
<div ng-controller="MainCtrl as vm">
<counter count="vm.count"></counter>
</div>
</div>
<script>
angular
.module('app', [])
.component('counter', {
bindings: {
count: '='
},
controller: 'CounterCtrl',
template: function ($element, $attrs) {
return [
'<div class="counter">',
'<p>Counter component</p>',
'<input type="text" ng-model="counter.count">',
'<button type="button" ng-click="counter.decrement();">-</button>',
'<button type="button" ng-click="counter.increment();">+</button>',
'</div>'
].join('');
}
})
.controller('CounterCtrl', function CounterCtrl() {
function increment() {
this.count++;
}
function decrement() {
this.count--;
}
this.increment = increment;
this.decrement = decrement;
})
.controller('MainCtrl', function MainCtrl() {
this.count = 4;
});
</script>
npm install --save angular-component
bower install https://github.com/toddmotto/angular-component.git
Ensure you're using the files from the dist
directory (contains compiled production-ready code). Ensure you place the script before the closing </body>
tag.
<body>
<!-- html above -->
<script src="angular-1.x.js"></script>
<script src="dist/angular-component.js"></script>
<script src="app.js"></script>
</body>
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Gulp.
bindings
is omitted, short-circuit if .component() is already supportedFAQs
Angular component() polyfill
The npm package angular-component receives a total of 476 weekly downloads. As such, angular-component popularity was classified as not popular.
We found that angular-component demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers 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
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
Security News
Socket CEO Feross Aboukhadijeh discusses open source security challenges, including zero-day attacks and supply chain risks, on the Cyber Security Council podcast.
Security News
Research
Socket researchers uncover how threat actors weaponize Out-of-Band Application Security Testing (OAST) techniques across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.