Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
angular2-expandable-list
Advanced tools
Expandable lists made easy for Angular2
angular2-expandable-list is an HTML <angular2-expandable-list>
tag enhanced with styling and animation
npm
:# To get the latest stable version and update package.json file:
$ npm install angular2-expandable-list --save
or yarn
with:
$ yarn add angular2-expandable-list
If you are using System.js you may want to add this into map
and package
config:
{
"map": {
"angular2-expandable-list": "node_modules/angular2-expandable-list"
},
"packages": {
"angular2-expandable-list": {
"main": "index.js",
"defaultExtension": "js"
}
}
}
If you are using Webpack you may want to add this into your vendor.js
file:
// vendor.ts
import '@angular/platform-browser';
import '@angular/platform-browser-dynamic';
import '@angular/core';
import '@angular/common';
import '@angular/http';
// Third parties packages
import 'rxjs';
import 'angular2-expandable-list';
angular2-expandable-list class is an Angular2 module therefore, it needs to be registered in the modules array (encouraged way):
// app.module.ts
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { ExpandableListModule } from 'angular2-expandable-list';
import { AppComponent } from './app.component';
@NgModule({
declarations: [ AppComponent ],
imports: [
BrowserModule,
ExpandableListModule // import Angular's ExpandableListModule modules
],
bootstrap: [ AppComponent ]
})
export class AppModule { }
Use the component anywhere around your application:
// app.component.ts
import { Component } from '@angular/core';
@Component({
selector: 'app',
template: `
<expandable-list>
<expandable-list-item>
<span title>My List</span>
<a item href="http://www.goo.gl">Google</a>
<a item href="http://www.goo.gl">Google</a>
<a item href="http://www.goo.gl">Google</a>
</expandable-list-item>
</expandable-list>
`
})
export class AppComponent { }
The Angular2-expandable-list is composed of a <expandable-list>
wrapper and
one or more <expandable-list-item>
.
Start your list creating these 2 html tags in your template like this:
<expandable-list>
<expandable-list-item></expandable-list-item>
</expandable-list>
Now, each <expandable-list-item>
needs a title and a list of elements.
It is possible to create both a primary and a secondary title for each item like
the following example.
<expandable-list>
<expandable-list-item>
<span title>Primary Title</span>
<span secondary>Secondary</span>
</expandable-list-item>
</expandable-list>
Now you're ready to fill your list with some items.
<expandable-list>
<expandable-list-item>
<span title>Primary Title</span>
<span secondary>Secondary</span>
<a item href="http://www.goo.gl">Google</a>
<a item href="http://www.goo.gl">Google</a>
<a item href="http://www.goo.gl">Google</a>
</expandable-list-item>
</expandable-list>
It is important to append the html attribute item
to each of the item you want
to render in the list and it's up to you which HTML tag to use. We've just filled
our list with anchor link but feel free to use any other tag.
<expandable-list>
<expandable-list-item>
<span title>Primary Title</span>
<span secondary>Secondary</span>
<a item href="http://www.goo.gl">Google</a>
<a item href="http://www.goo.gl">Google</a>
<expandable-list-divider item></expandable-list-divider>
<a item href="http://www.goo.gl">Google</a>
</expandable-list-item>
</expandable-list>
We still need to postfix the expandable-list-divider
with the item
attribute to
see that divider rendered on the page.
Now you can create as many <expandable-list-item>
nodes as you want inside
your <expandable-list>
.
<expandable-list>
<expandable-list-item>
<span title>Primary Title</span>
<span secondary>Secondary</span>
<a item href="http://www.goo.gl">Google</a>
<a item href="http://www.goo.gl">Google</a>
<expandable-list-divider item></expandable-list-divider>
<a item href="http://www.goo.gl">Google</a>
</expandable-list-item>
<expandable-list-item>
<span title>Another list</span>
<a item href="http://www.goo.gl">Google</a>
<a item href="http://www.goo.gl">Google</a>
</expandable-list-item>
</expandable-list>
Have a look at the demo
available in this repository for a real Angular2 application using the Angular2-expandable-list
library.
From your terminal all the Node dependencies using npm:
$ npm install
# Or Yarn
$ yarn install
Then initialize the application with:
$ npm run demo
Open your browser to http://localhost:8080/ to see the application running.
This package is using the AngularJS commit messages as default way to contribute with commitizen node package integrated in this repository.
git checkout -b my-new-feature
git add .
npm run commit
git push origin my-new-feature
Changelog available here
MIT License © Andrea SonnY
FAQs
Expandable lists made easy for Angular2+
The npm package angular2-expandable-list receives a total of 2 weekly downloads. As such, angular2-expandable-list popularity was classified as not popular.
We found that angular2-expandable-list 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 researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.