Skip to content

Instantly share code, notes, and snippets.

Sébastien Sougnez ssougnez

Block or report user

Report or block ssougnez

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View wp-ngDoCheck-05.ts
import { Component, Input, IterableDiffer, IterableDiffers, OnInit, DoCheck, IterableChanges } from '@angular/core';
@Component({
selector: 'data-table',
templateUrl: './data-table.component.html'
})
export class DataTableComponent implements OnInit, DoCheck {
@Input()
public data: number[] = [];
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-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-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-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.