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'; | '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 { BaseComponent, SpecManager } from '../base'; | ||||||
| import { SchemaNormalizer, SchemaHelper } from '../../services/index'; | import { SchemaNormalizer, SchemaHelper } from '../../services/index'; | ||||||
|  | @ -8,7 +8,8 @@ import { SchemaNormalizer, SchemaHelper } from '../../services/index'; | ||||||
| @Component({ | @Component({ | ||||||
|   selector: 'json-schema', |   selector: 'json-schema', | ||||||
|   templateUrl: './json-schema.html', |   templateUrl: './json-schema.html', | ||||||
|   styleUrls: ['./json-schema.css'] |   styleUrls: ['./json-schema.css'], | ||||||
|  |   changeDetection: ChangeDetectionStrategy.OnPush | ||||||
| }) | }) | ||||||
| export class JsonSchema extends BaseComponent implements OnInit { | export class JsonSchema extends BaseComponent implements OnInit { | ||||||
|   @Input() pointer: string; |   @Input() pointer: string; | ||||||
|  |  | ||||||
|  | @ -1,5 +1,5 @@ | ||||||
| 'use strict'; | 'use strict'; | ||||||
| import { Input, Component, OnInit } from '@angular/core'; | import { Input, Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; | ||||||
| import JsonPointer from '../../utils/JsonPointer'; | import JsonPointer from '../../utils/JsonPointer'; | ||||||
| import { BaseComponent, SpecManager } from '../base'; | import { BaseComponent, SpecManager } from '../base'; | ||||||
| import { SchemaHelper } from '../../services/schema-helper.service'; | import { SchemaHelper } from '../../services/schema-helper.service'; | ||||||
|  | @ -8,6 +8,7 @@ import { SchemaHelper } from '../../services/schema-helper.service'; | ||||||
|   selector: 'method', |   selector: 'method', | ||||||
|   templateUrl: './method.html', |   templateUrl: './method.html', | ||||||
|   styleUrls: ['./method.css'], |   styleUrls: ['./method.css'], | ||||||
|  |   changeDetection: ChangeDetectionStrategy.OnPush | ||||||
| }) | }) | ||||||
| export class Method extends BaseComponent implements OnInit { | export class Method extends BaseComponent implements OnInit { | ||||||
|   @Input() pointer:string; |   @Input() pointer:string; | ||||||
|  |  | ||||||
|  | @ -1,12 +1,13 @@ | ||||||
| 'use strict'; | 'use strict'; | ||||||
| import { Component, Input, OnInit } from '@angular/core'; | import { Component, Input, OnInit, ChangeDetectionStrategy } from '@angular/core'; | ||||||
| import { BaseComponent, SpecManager } from '../base'; | import { BaseComponent, SpecManager } from '../base'; | ||||||
| import { SchemaHelper } from '../../services/index'; | import { SchemaHelper } from '../../services/index'; | ||||||
| 
 | 
 | ||||||
| @Component({ | @Component({ | ||||||
|   selector: 'methods-list', |   selector: 'methods-list', | ||||||
|   templateUrl: './methods-list.html', |   templateUrl: './methods-list.html', | ||||||
|   styleUrls: ['./methods-list.css'] |   styleUrls: ['./methods-list.css'], | ||||||
|  |   changeDetection: ChangeDetectionStrategy.OnPush | ||||||
| }) | }) | ||||||
| export class MethodsList extends BaseComponent implements OnInit { | export class MethodsList extends BaseComponent implements OnInit { | ||||||
|   @Input() pointer:string; |   @Input() pointer:string; | ||||||
|  |  | ||||||
|  | @ -1,6 +1,6 @@ | ||||||
| 'use strict'; | '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 { BrowserDomAdapter as DOM } from '../../utils/browser-adapter'; | ||||||
| import { BaseComponent } from '../base'; | import { BaseComponent } from '../base'; | ||||||
|  | @ -14,6 +14,7 @@ import { OptionsService, RedocEventsService } from '../../services/index'; | ||||||
|   selector: 'redoc', |   selector: 'redoc', | ||||||
|   templateUrl: './redoc.html', |   templateUrl: './redoc.html', | ||||||
|   styleUrls: ['./redoc.css'], |   styleUrls: ['./redoc.css'], | ||||||
|  |   changeDetection: ChangeDetectionStrategy.OnPush | ||||||
| }) | }) | ||||||
| export class Redoc extends BaseComponent implements AfterViewInit { | export class Redoc extends BaseComponent implements AfterViewInit { | ||||||
|   static appRef: ComponentRef<any>; |   static appRef: ComponentRef<any>; | ||||||
|  |  | ||||||
|  | @ -1,6 +1,6 @@ | ||||||
| 'use strict'; | 'use strict'; | ||||||
| 
 | 
 | ||||||
| import { Component, Input, OnInit } from '@angular/core'; | import { Component, Input, OnInit, ChangeDetectionStrategy } from '@angular/core'; | ||||||
| import { BaseComponent, SpecManager } from '../base'; | import { BaseComponent, SpecManager } from '../base'; | ||||||
| import JsonPointer from '../../utils/JsonPointer'; | import JsonPointer from '../../utils/JsonPointer'; | ||||||
| import { statusCodeType } from '../../utils/helpers'; | import { statusCodeType } from '../../utils/helpers'; | ||||||
|  | @ -14,7 +14,8 @@ function isNumeric(n) { | ||||||
| @Component({ | @Component({ | ||||||
|   selector: 'responses-list', |   selector: 'responses-list', | ||||||
|   templateUrl: './responses-list.html', |   templateUrl: './responses-list.html', | ||||||
|   styleUrls: ['./responses-list.css'] |   styleUrls: ['./responses-list.css'], | ||||||
|  |   changeDetection: ChangeDetectionStrategy.OnPush | ||||||
| }) | }) | ||||||
| export class ResponsesList extends BaseComponent implements OnInit { | export class ResponsesList extends BaseComponent implements OnInit { | ||||||
|   @Input() pointer:string; |   @Input() pointer:string; | ||||||
|  |  | ||||||
|  | @ -1,6 +1,6 @@ | ||||||
| 'use strict'; | 'use strict'; | ||||||
| 
 | 
 | ||||||
| import { Component, Input, OnInit } from '@angular/core'; | import { Component, Input, OnInit, ChangeDetectionStrategy } from '@angular/core'; | ||||||
| import { BaseComponent, SpecManager } from '../base'; | import { BaseComponent, SpecManager } from '../base'; | ||||||
| import JsonPointer from '../../utils/JsonPointer'; | import JsonPointer from '../../utils/JsonPointer'; | ||||||
| import { statusCodeType } from '../../utils/helpers'; | import { statusCodeType } from '../../utils/helpers'; | ||||||
|  | @ -19,6 +19,7 @@ function hasExample(response) { | ||||||
|   selector: 'responses-samples', |   selector: 'responses-samples', | ||||||
|   templateUrl: './responses-samples.html', |   templateUrl: './responses-samples.html', | ||||||
|   styleUrls: ['./responses-samples.css'], |   styleUrls: ['./responses-samples.css'], | ||||||
|  |   changeDetection: ChangeDetectionStrategy.OnPush | ||||||
| }) | }) | ||||||
| export class ResponsesSamples extends BaseComponent implements OnInit { | export class ResponsesSamples extends BaseComponent implements OnInit { | ||||||
|   @Input() pointer:string; |   @Input() pointer:string; | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user