Use ng-metadata as a Backport of Angular 2+ API (#2486)

* starting UtilService refactor

* pre find-replace angular.module('quay') => angular.module('QuayModule')

* successfully switched to ng-metadata for backported Angular2 API

* working with parent component reference in child

* fixing @Output to use EventEmitter

* fixed @Output events for custom git trigger

* more fixes

* refactored QuayPages module for backwards-compatibility

* reinitialized test.db

* use minified libraries

* replaced references for angular-ts-decorators

* fixed ng-show
This commit is contained in:
Alec Merdler 2017-04-05 14:14:08 -07:00 committed by GitHub
parent 6352b3cac5
commit 7a352ddfbc
43 changed files with 642 additions and 551 deletions

View file

@ -1,4 +1,4 @@
import { Component, Output, Input } from 'angular-ts-decorators';
import { Component, Input, Inject, Host, OnChanges, OnInit, SimpleChanges } from 'ng-metadata/core';
import { LinearWorkflowComponent } from './linear-workflow.component';
@ -6,27 +6,29 @@ import { LinearWorkflowComponent } from './linear-workflow.component';
* A component which displays a single section in a linear workflow.
*/
@Component({
selector: 'linearWorkflowSection',
selector: 'linear-workflow-section',
templateUrl: '/static/js/directives/ui/linear-workflow/linear-workflow-section.component.html',
transclude: true,
require: {
parent: '^^linearWorkflow'
legacy: {
transclude: true
}
})
export class LinearWorkflowSectionComponent implements ng.IComponentController {
export class LinearWorkflowSectionComponent implements OnChanges, OnInit {
@Input('@') public sectionId: string;
@Input('@') public sectionTitle: string;
@Input() public sectionValid: boolean = false;
public sectionVisible: boolean = false;
public isCurrentSection: boolean = false;
public parent: LinearWorkflowComponent;
public $onInit(): void {
constructor(@Host() @Inject(LinearWorkflowComponent) private parent: LinearWorkflowComponent) {
}
public ngOnInit(): void {
this.parent.addSection(this);
}
public $onChanges(changes: ng.IOnChangesObject): void {
public ngOnChanges(changes: SimpleChanges): void {
if (changes['sectionValid'] !== undefined && !changes['sectionValid'].currentValue) {
this.parent.onSectionInvalid(this.sectionId);
}