
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
ngx-laydate
Advanced tools
The Angular Directive for Laydate, built for modern Angular applications.
Check out the component in action: https://lanxuexing.github.io/ngx-laydate/
# if you use npm
npm install layui-laydate -S
npm install ngx-laydate -S
# or if you use yarn
yarn add layui-laydate
yarn add ngx-laydate
🔥 Pro Tip: To utilize the latest Laydate features, replace "layui-laydate" with "laydate-next" and update the asset dependencies in your
angular.jsonfile.
Import NgxLaydateDirective directly in your component:
import { NgxLaydateDirective, NGX_LAYDATE_CONFIG } from 'ngx-laydate';
@Component({
standalone: true,
selector: 'app-root',
imports: [NgxLaydateDirective],
providers: [
{
provide: NGX_LAYDATE_CONFIG,
useFactory: () => ({
// Use standard import or custom path
// @ts-ignore
laydate: () => import('layui-laydate'),
path: 'assets/laydate/'
}),
},
],
template: `
<input laydate [options]="laydateOption" />
`
})
export class AppComponent {
laydateOption = {
lang: 'en',
type: 'datetime',
value: '2023-10-14 00:00:00'
};
}
Import NgxLaydateModule in your module:
import { NgxLaydateModule } from 'ngx-laydate';
@NgModule({
imports: [
NgxLaydateModule.forRoot({
// @ts-ignore
laydate: () => import('layui-laydate'),
path: 'assets/laydate/'
}),
],
})
export class AppModule {}
Add the laydate assets to your angular.json. This ensures themes and styles load correctly.
{
"architect": {
"build": {
"options": {
"assets": [
{
"glob": "**/*",
"input": "node_modules/layui-laydate/dist/",
"output": "assets/laydate"
}
]
}
}
}
}
| Input | Type | Default | Description |
|---|---|---|---|
[options] | LaydateOptions | null | Configuration object matching the official Laydate documentation. |
ngx-laydate proxies native Laydate events with a laydate prefix.
| @Output | Description |
|---|---|
(laydateInit) | Emitted when the instance is initialized. |
(laydateReady) | Emitted when the picker is displayed (ready callback). |
(laydateChange) | Emitted when the value changes (done callback). |
(laydateDone) | Same as change, consistent with native naming. |
(laydateClose) | Emitted when the picker is closed (close callback). |
Example:
<input laydate [options]="opts" (laydateDone)="onDone($event)" />
onDone([value, date, endDate]): void {
console.log('Selected:', value);
console.log('Date Object:', date);
}
Clone the repo and start the demo:
npm install
npm run start
Visit: http://localhost:4200
FAQs
An angular (ver >= 2.x) directive for Laydate (ver >= 5.x) 🚀
We found that ngx-laydate demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.