Skip to content

Instantly share code, notes, and snippets.

Avatar

Sébastien Sougnez ssougnez

View GitHub Profile
View wp-ngDoCheck-04.html
<ul>
<li *ngFor="let item of sorted">{{ item }}</li>
</ul>
View wp-ngDoCheck-03.ts
import { Component, Input } from '@angular/core';
@Component({
selector: 'data-table',
templateUrl: './data-table.component.html'
})
export class DataTableComponent {
@Input()
public data: number[] = [];
View wp-ngDoCheck-02.html
<data-table [data]="numbers"></data-table>
<button (click)="add()">Add</button>
<button (click)="edit()">Edit</button>
View wp-ngDoCheck-01.ts
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
public numbers: number[] = [5, 69, 9];
View wp-handle-document-events-differently-with-udocumenteventhandler-07.cs
[DocumentEventHandler(Include = new[] { DocumentTypeA.ModelTypeAlias, DocumentTypeB.ModelTypeAlias }, Exclude = new[] { DocumentTypeC.ModelTypeAlias })]
View wp-handle-document-events-differently-with-udocumenteventhandler-06.cs
public class DocumentEventHandlerRegistration : ApplicationEventHandler
{
protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
{
DocumentEventHandlerBinder.Bind(GetType().Assembly);
}
}
View wp-handle-document-events-differently-with-udocumenteventhandler-04.cs
[DocumentEventHandler(Include = new[] { "documentTypeA", "documentTypeB" }, Exclude = new[] { "documentTypeC" })]
public class DocumentTypeAEventHandler : DocumentEventHandler
{
public override void Saved(IContentService contentService, SaveEventArgs<IContent> args)
{
// Do stuff
}
public override void Saving(IContentService contentService, SaveEventArgs<IContent> args)
{
View wp-handle-document-events-differently-with-udocumenteventhandler-03.cs
[DocumentEventHandler(Include = new[] { "documentTypeA" })]
public class DocumentTypeAEventHandler : DocumentEventHandler
{
public override void Saving(IContentService contentService, SaveEventArgs<IContent> args)
{
base.Saving(contentService, args);
}
}
View wp-handle-document-events-differently-with-udocumenteventhandler-02.cs
public class DocumentEventHandlerRegistration : ApplicationEventHandler
{
protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
{
ContentService.Saving += ContentService_Saving;
ContentService.Saved += ContentService_Saved;
ContentService.Publishing += ContentService_Publishing;
}
private void ContentService_Saved(IContentService sender, SaveEventArgs<IContent> e)
You can’t perform that action at this time.