Skip to content

Commit

Permalink
feat: remove change detection strategy from all components (#101)
Browse files Browse the repository at this point in the history
BREAKING CHANGE:

For enhanced performance it is recommended that you add `changeDetection: ChangeDetectionStrategy.OnPush` on all components that use this library. This will restrict change detection to only run when the components inputs change

Closes #94
  • Loading branch information
mattlewis92 authored Dec 18, 2016
1 parent 6e752bf commit 36458ab
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 7 deletions.
3 changes: 2 additions & 1 deletion demo/demo.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component } from '@angular/core';
import { Component, ChangeDetectionStrategy } from '@angular/core';
import {
startOfDay,
subDays,
Expand Down Expand Up @@ -36,6 +36,7 @@ const colors: any = {

@Component({
selector: 'mwl-demo-app',
changeDetection: ChangeDetectionStrategy.OnPush,
styles: [`
h3 {
margin: 0;
Expand Down
2 changes: 0 additions & 2 deletions src/components/day/calendarDayView.component.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {
Component,
ChangeDetectionStrategy,
Input,
OnChanges,
Output,
Expand All @@ -20,7 +19,6 @@ const SEGMENT_HEIGHT: number = 30;

@Component({
selector: 'mwl-calendar-day-view',
changeDetection: ChangeDetectionStrategy.OnPush,
template: `
<div class="cal-day-view">
<mwl-calendar-all-day-event
Expand Down
2 changes: 0 additions & 2 deletions src/components/month/calendarMonthView.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
Input,
Output,
EventEmitter,
ChangeDetectionStrategy,
ChangeDetectorRef,
OnInit,
OnDestroy,
Expand All @@ -25,7 +24,6 @@ import isSameDay from 'date-fns/is_same_day';

@Component({
selector: 'mwl-calendar-month-view',
changeDetection: ChangeDetectionStrategy.OnPush,
template: `
<div class="cal-month-view">
<div class="cal-cell-row cal-header">
Expand Down
2 changes: 0 additions & 2 deletions src/components/week/calendarWeekView.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {
Input,
Output,
EventEmitter,
ChangeDetectionStrategy,
ChangeDetectorRef,
OnChanges,
OnInit,
Expand All @@ -27,7 +26,6 @@ import { CalendarEventTimesChangedEvent } from './../../interfaces/calendarEvent

@Component({
selector: 'mwl-calendar-week-view',
changeDetection: ChangeDetectionStrategy.OnPush,
template: `
<div class="cal-week-view">
<div class="cal-day-headers">
Expand Down

0 comments on commit 36458ab

Please sign in to comment.