mirror of
				https://github.com/Redocly/redoc.git
				synced 2025-10-30 23:37:28 +03:00 
			
		
		
		
	ChangeDetectionStrategy.OnPush for components
This commit is contained in:
		
							parent
							
								
									919f0c380d
								
							
						
					
					
						commit
						c384163be0
					
				|  | @ -1,6 +1,6 @@ | |||
| 'use strict'; | ||||
| 
 | ||||
| import { Component, Input, Renderer, ElementRef, OnInit } from '@angular/core'; | ||||
| import { Component, Input, Renderer, ElementRef, OnInit, ChangeDetectionStrategy } from '@angular/core'; | ||||
| 
 | ||||
| import { BaseComponent, SpecManager } from '../base'; | ||||
| import { SchemaNormalizer, SchemaHelper } from '../../services/index'; | ||||
|  | @ -8,7 +8,8 @@ import { SchemaNormalizer, SchemaHelper } from '../../services/index'; | |||
| @Component({ | ||||
|   selector: 'json-schema', | ||||
|   templateUrl: './json-schema.html', | ||||
|   styleUrls: ['./json-schema.css'] | ||||
|   styleUrls: ['./json-schema.css'], | ||||
|   changeDetection: ChangeDetectionStrategy.OnPush | ||||
| }) | ||||
| export class JsonSchema extends BaseComponent implements OnInit { | ||||
|   @Input() pointer: string; | ||||
|  |  | |||
|  | @ -1,5 +1,5 @@ | |||
| 'use strict'; | ||||
| import { Input, Component, OnInit } from '@angular/core'; | ||||
| import { Input, Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; | ||||
| import JsonPointer from '../../utils/JsonPointer'; | ||||
| import { BaseComponent, SpecManager } from '../base'; | ||||
| import { SchemaHelper } from '../../services/schema-helper.service'; | ||||
|  | @ -8,6 +8,7 @@ import { SchemaHelper } from '../../services/schema-helper.service'; | |||
|   selector: 'method', | ||||
|   templateUrl: './method.html', | ||||
|   styleUrls: ['./method.css'], | ||||
|   changeDetection: ChangeDetectionStrategy.OnPush | ||||
| }) | ||||
| export class Method extends BaseComponent implements OnInit { | ||||
|   @Input() pointer:string; | ||||
|  |  | |||
|  | @ -1,12 +1,13 @@ | |||
| 'use strict'; | ||||
| import { Component, Input, OnInit } from '@angular/core'; | ||||
| import { Component, Input, OnInit, ChangeDetectionStrategy } from '@angular/core'; | ||||
| import { BaseComponent, SpecManager } from '../base'; | ||||
| import { SchemaHelper } from '../../services/index'; | ||||
| 
 | ||||
| @Component({ | ||||
|   selector: 'methods-list', | ||||
|   templateUrl: './methods-list.html', | ||||
|   styleUrls: ['./methods-list.css'] | ||||
|   styleUrls: ['./methods-list.css'], | ||||
|   changeDetection: ChangeDetectionStrategy.OnPush | ||||
| }) | ||||
| export class MethodsList extends BaseComponent implements OnInit { | ||||
|   @Input() pointer:string; | ||||
|  |  | |||
|  | @ -1,6 +1,6 @@ | |||
| 'use strict'; | ||||
| 
 | ||||
| import { ElementRef, ComponentRef, AfterViewInit, Component } from '@angular/core'; | ||||
| import { ElementRef, ComponentRef, AfterViewInit, Component, ChangeDetectionStrategy} from '@angular/core'; | ||||
| 
 | ||||
| import { BrowserDomAdapter as DOM } from '../../utils/browser-adapter'; | ||||
| import { BaseComponent } from '../base'; | ||||
|  | @ -14,6 +14,7 @@ import { OptionsService, RedocEventsService } from '../../services/index'; | |||
|   selector: 'redoc', | ||||
|   templateUrl: './redoc.html', | ||||
|   styleUrls: ['./redoc.css'], | ||||
|   changeDetection: ChangeDetectionStrategy.OnPush | ||||
| }) | ||||
| export class Redoc extends BaseComponent implements AfterViewInit { | ||||
|   static appRef: ComponentRef<any>; | ||||
|  |  | |||
|  | @ -1,6 +1,6 @@ | |||
| 'use strict'; | ||||
| 
 | ||||
| import { Component, Input, OnInit } from '@angular/core'; | ||||
| import { Component, Input, OnInit, ChangeDetectionStrategy } from '@angular/core'; | ||||
| import { BaseComponent, SpecManager } from '../base'; | ||||
| import JsonPointer from '../../utils/JsonPointer'; | ||||
| import { statusCodeType } from '../../utils/helpers'; | ||||
|  | @ -14,7 +14,8 @@ function isNumeric(n) { | |||
| @Component({ | ||||
|   selector: 'responses-list', | ||||
|   templateUrl: './responses-list.html', | ||||
|   styleUrls: ['./responses-list.css'] | ||||
|   styleUrls: ['./responses-list.css'], | ||||
|   changeDetection: ChangeDetectionStrategy.OnPush | ||||
| }) | ||||
| export class ResponsesList extends BaseComponent implements OnInit { | ||||
|   @Input() pointer:string; | ||||
|  |  | |||
|  | @ -1,6 +1,6 @@ | |||
| 'use strict'; | ||||
| 
 | ||||
| import { Component, Input, OnInit } from '@angular/core'; | ||||
| import { Component, Input, OnInit, ChangeDetectionStrategy } from '@angular/core'; | ||||
| import { BaseComponent, SpecManager } from '../base'; | ||||
| import JsonPointer from '../../utils/JsonPointer'; | ||||
| import { statusCodeType } from '../../utils/helpers'; | ||||
|  | @ -19,6 +19,7 @@ function hasExample(response) { | |||
|   selector: 'responses-samples', | ||||
|   templateUrl: './responses-samples.html', | ||||
|   styleUrls: ['./responses-samples.css'], | ||||
|   changeDetection: ChangeDetectionStrategy.OnPush | ||||
| }) | ||||
| export class ResponsesSamples extends BaseComponent implements OnInit { | ||||
|   @Input() pointer:string; | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	Block a user