Skip to content

Commit

Permalink
fix(build): fixed tslint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
valorkin committed Dec 4, 2016
1 parent 7bfbdd4 commit a323690
Show file tree
Hide file tree
Showing 33 changed files with 217 additions and 172 deletions.
2 changes: 1 addition & 1 deletion angular-cli.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"main": "main.ts",
"test": "../../scripts/test.ts",
"tsconfig": "tsconfig.json",
"prefix": "app",
"prefix": "",
"mobile": false,
"styles": [
],
Expand Down
8 changes: 4 additions & 4 deletions demo/e2e/data-provider/data-provider.po.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,10 @@ export class DataProvider {
'Grouped results modal text': {element: (): ElementFinder => $('.card:nth-child(14)'), actualResult: 'Model: ""'}
};
public static typeaheadInputCityTexts:any = {
'California': { inputText: 'Cal', expectedResult: 'California'},
'Texas': { inputText: 'xa', expectedResult: 'Texas'},
'Florida': { inputText: 'rida', expectedResult: 'Florida'},
'Mississippi': { inputText: 'ssi', expectedResult: 'Mississippi'},
California: { inputText: 'Cal', expectedResult: 'California'},
Texas: { inputText: 'xa', expectedResult: 'Texas'},
Florida: { inputText: 'rida', expectedResult: 'Florida'},
Mississippi: { inputText: 'ssi', expectedResult: 'Mississippi'},
'New Jersey': { inputText: 'J', expectedResult: 'New Jersey'}
};
}
1 change: 0 additions & 1 deletion demo/e2e/tests/modals-demo.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { $, browser } from 'protractor';
import { leftPanelTests } from './leftPanelTests.po';
import { DataProvider } from '../data-provider/data-provider.po';


const buttonLargeModal = $('.btn:nth-child(1)');
const buttonSmallModal = $('.btn:nth-child(3)');
const buttonChildModal = $('.btn:nth-child(5)');
Expand Down
1 change: 0 additions & 1 deletion demo/e2e/tests/typeahead-demo.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { $, browser } from 'protractor';
import { leftPanelTests } from './leftPanelTests.po';
import { DataProvider } from '../data-provider/data-provider.po';


let using = require('jasmine-data-provider');

const inputStatic = $('.container-fluid>input:nth-of-type(1)');
Expand Down
4 changes: 3 additions & 1 deletion demo/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ if (w && w.__theme === 'bs4') {
export class AppComponent implements AfterContentInit {
public isBs3:boolean = Ng2BootstrapConfig.theme === Ng2BootstrapTheme.BS3;

public constructor(private router:Router, componentsHelper:ComponentsHelper, vcr:ViewContainerRef) {
private router:Router;
public constructor(router:Router, componentsHelper:ComponentsHelper, vcr:ViewContainerRef) {
this.router = router;
componentsHelper.setRootViewContainerRef(vcr);
}

Expand Down
4 changes: 3 additions & 1 deletion demo/src/app/common/main-menu/main-menu.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ export class MainMenuComponent {
public search:any = {};
public hash:string = '';

public constructor(private router:Router) {
private router: Router;
public constructor(router:Router) {
this.router = router;
this.routes = this.routes.filter((v:any) => v.path !== '**');
this.router.events.subscribe((event:any) => {
if (event instanceof NavigationEnd) {
Expand Down
4 changes: 3 additions & 1 deletion demo/src/app/common/top-menu/top-menu.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ export class TopMenuComponent implements AfterViewInit {
private renderer:Renderer;
private document:any;

public constructor(renderer:Renderer, @Inject(DOCUMENT) document:any, private router:Router) {
private router:Router;
public constructor(renderer:Renderer, @Inject(DOCUMENT) document:any, router:Router) {
this.router = router;
this.renderer = renderer;
this.document = document;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,20 @@ import * as moment from 'moment';
templateUrl: './datepicker-demo.component.html'
})
export class DatepickerDemoComponent {
public dt:Date = new Date();
public minDate:Date = void 0;
public events:any[];
public tomorrow:Date;
public afterTomorrow:Date;
public dt: Date = new Date();
public minDate: Date = void 0;
public events: any[];
public tomorrow: Date;
public afterTomorrow: Date;
public dateDisabled: {date: Date, mode: string}[];
public formats:string[] = ['DD-MM-YYYY', 'YYYY/MM/DD', 'DD.MM.YYYY', 'shortDate'];
public format:string = this.formats[0];
public dateOptions:any = {
public formats: string[] = ['DD-MM-YYYY', 'YYYY/MM/DD', 'DD.MM.YYYY',
'shortDate'];
public format: string = this.formats[0];
public dateOptions: any = {
formatYear: 'YY',
startingDay: 1
};
private opened:boolean = false;
private opened: boolean = false;

public constructor() {
(this.tomorrow = new Date()).setDate(this.tomorrow.getDate() + 1);
Expand All @@ -31,53 +32,54 @@ export class DatepickerDemoComponent {
];
}

public getDate():number {
public getDate(): number {
return this.dt && this.dt.getTime() || new Date().getTime();
}

public today():void {
public today(): void {
this.dt = new Date();
}

public d20090824():void {
this.dt = moment('2009-08-24', 'YYYY-MM-DD').toDate();
public d20090824(): void {
this.dt = moment('2009-08-24', 'YYYY-MM-DD')
.toDate();
}

public disableTomorrow(): void {
this.dateDisabled = [{date: this.tomorrow, mode: 'day'}];
}

// todo: implement custom class cases
public getDayClass(date:any, mode:string):string {
public getDayClass(date: any, mode: string): string {
if (mode === 'day') {
let dayToCheck = new Date(date).setHours(0, 0, 0, 0);

for (let i = 0; i < this.events.length; i++) {
let currentDay = new Date(this.events[i].date).setHours(0, 0, 0, 0);
for (let event of this.events) {
let currentDay = new Date(event.date).setHours(0, 0, 0, 0);

if (dayToCheck === currentDay) {
return this.events[i].status;
return event.status;
}
}
}

return '';
}

public disabled(date:Date, mode:string):boolean {
public disabled(date: Date, mode: string): boolean {
return ( mode === 'day' && ( date.getDay() === 0 || date.getDay() === 6 ) );
}

public open():void {
public open(): void {
this.opened = !this.opened;
}

public clear():void {
public clear(): void {
this.dt = void 0;
this.dateDisabled = undefined;
}

public toggleMin():void {
public toggleMin(): void {
this.dt = new Date(this.minDate.valueOf());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ export class PaginationDemoComponent {

public setPage(pageNo:number):void {
this.currentPage = pageNo;
};
}

public pageChanged(event:any):void {
console.log('Page changed to: ' + event.page);
console.log('Number items per page: ' + event.itemsPerPage);
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export class ProgressbarDemoComponent {
this.showWarning = (type === 'danger' || type === 'warning');
this.dynamic = value;
this.type = type;
};
}

public randomStacked(): void {
let types = ['success', 'info', 'warning', 'danger'];
Expand All @@ -62,5 +62,5 @@ export class ProgressbarDemoComponent {
type: types[index]
});
}
};
}
}
6 changes: 3 additions & 3 deletions demo/src/app/components/tabs/demos/tabs-demo.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ export class TabsDemoComponent {
setTimeout(function ():void {
alert('You\'ve selected the alert tab!');
});
};
}

public setActiveTab(index:number):void {
this.tabs[index].active = true;
};
}

public removeTabHandler(/*tab:any*/):void {
console.log('Remove Tab handler');
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,20 @@ export class TimepickerDemoComponent {

public toggleMode():void {
this.ismeridian = !this.ismeridian;
};
}

public update():void {
let d = new Date();
d.setHours(14);
d.setMinutes(0);
this.mytime = d;
};
}

public changed():void {
console.log('Time changed to: ' + this.mytime);
};
}

public clear():void {
this.mytime = void 0;
};
}
}
2 changes: 1 addition & 1 deletion demo/src/index-bs4.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<link href="https://fonts.googleapis.com/css?family=Roboto:400,300,700" rel="stylesheet" type="text/css">

<!--link to bootstrap.css v4.0.0-alpha-->
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.5/css/bootstrap.min.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.5/css/bootstrap.min.css" rel="stylesheet">
<!--<link rel="stylesheet" href="../node_modules/bootstrap/dist/css/bootstrap.css">-->
<link rel="stylesheet" href="assets/css/glyphicons.css">
<link rel="stylesheet" href="assets/css/style.css">
Expand Down
2 changes: 1 addition & 1 deletion demo/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<!--<link href="https://fonts.googleapis.com/css?family=Source+Code+Pro" rel="stylesheet" type="text/css">-->

<!--link to bootstrap.css-->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" href="assets/css/style.css">
<link rel="stylesheet" href="assets/css/prettify-angulario.css">
</head>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"build": "ngm build -p src",
"start": "ng serve --aot",
"generate-bs4": "node scripts/generate-bs4.js",
"pretest": "run-s build link",
"pretest": "run-s link build link",
"test": "ng test -sr",
"test-coverage": "ng test -sr -cc",
"pree2e": "webdriver-manager update",
Expand Down
4 changes: 2 additions & 2 deletions scripts/generate-bs4.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ const files = {

const toReplace = [
{
from: '<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">',
to: '<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.5/css/bootstrap.min.css" rel="stylesheet">'
from: '<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">',
to: '<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.5/css/bootstrap.min.css" rel="stylesheet">'
}, {
from: '<script src="assets/js/prettify.min.js"></script>',
to: '<script src="assets/js/prettify.min.js"></script>\r\n <!-- Enable bootstrap 4 theme -->\r\n <script>window.__theme = \'bs4\';</script>'
Expand Down
5 changes: 3 additions & 2 deletions src/alert/alert.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ const ALERT_TEMPLATE = `
</div>
`;

// TODO: templateUrl
@Component({
selector: 'alert',
template: ALERT_TEMPLATE
Expand All @@ -26,7 +25,9 @@ export class AlertComponent implements OnInit {
public closed: boolean;
protected classes:string[] = [];

public constructor(public config: AlertConfig) {
public config: AlertConfig;
public constructor(config: AlertConfig) {
this.config = config;
this.configureOptions();
}

Expand Down
4 changes: 3 additions & 1 deletion src/buttons/button-checkbox.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { ControlValueAccessor, NgModel } from '@angular/forms';
@Directive({selector: '[btnCheckbox][ngModel]'})
export class ButtonCheckboxDirective implements ControlValueAccessor, OnInit {
public cd:NgModel;
public el: ElementRef;
@Input() public btnCheckboxTrue:any;

@Input() public btnCheckboxFalse:any;
Expand All @@ -29,7 +30,8 @@ export class ButtonCheckboxDirective implements ControlValueAccessor, OnInit {
this.cd.viewToModelUpdate(this.value);
}

public constructor(@Self() cd:NgModel, protected el: ElementRef) {
public constructor(@Self() cd:NgModel, el: ElementRef) {
this.el = el;
this.cd = cd;
// hack !
cd.valueAccessor = this;
Expand Down
5 changes: 4 additions & 1 deletion src/buttons/button-radio.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ export class ButtonRadioDirective implements ControlValueAccessor, OnInit {
@Input() public uncheckable:boolean;
@Input() public value:any;

protected el: ElementRef;

@HostBinding('class.active')
public get isActive(): boolean {
return this.btnRadio === this.value;
Expand All @@ -42,7 +44,8 @@ export class ButtonRadioDirective implements ControlValueAccessor, OnInit {
this.onChange(this.value);
}

public constructor( protected el: ElementRef) {
public constructor(el: ElementRef) {
this.el = el;
}

public ngOnInit(): void {
Expand Down
Loading

0 comments on commit a323690

Please sign in to comment.