0
- 私は角2とtypescriptを初めて使用しています。
- 私は自分のコードで以下のエラーに直面しています。
- 私はエラーのためにグーグルと彼らはインポートステートメントを含めるように頼んだ。
- でも、まだエラーは発生していません。
- あなたは私にそれを修正する方法を教えてもらえますか?
- 下記のコードとエラーを提供しています。
- 私は、私はすべての可能な解決策
///<reference path="../../../assets/js/jquery/jquery.d.ts" />
import {NgModule, CUSTOM_ELEMENTS_SCHEMA,Component, ElementRef, Inject, OnInit, ViewChild} from '@angular/core';
import {Http,HttpModule, Response,Headers, RequestOptions } from '@angular/http';
import {KendoGridComponent} from '../grid/grid.component';
//import { TranslateService } from '../../translate/translate.service';
import { SPORTSService } from '../../services/sports.service';
import {jumpService} from '../jump/jumpService';
import { FormsModule } from '@angular/forms';
import {Observable} from 'rxjs/Rx';
declare let $:any;
@Component({
selector: 'PaperDocuments',
template: `<div id="windowcontainer"></div>`
})
export class PaperDocuments {
@ViewChild(KendoGridComponent) private gridmobile: KendoGridComponent;
private dataSourceVal;
private MainGrid;
private grid;
private isVisible = false;
public toggleCollapse : string;
private kPopUpWindowViewHistory;
private fileName;
private scrollClicked;
private dynamicnetwks;
/*Localization*/
public show: string;
public all: string;
public entries: string;
public cancelBtn: string;
public okBtn: string;
public attachBtn:string;
public elfBtn: string;
public browseBtn:string;
public dragDrop: string;
public clearBtn:string;
public attachmentType:string;
public fileSelect:string;
private Type = ["PRM", "STR","FRT", "Urban Legends"];
private isDone: boolean = true
private filesToUpload: Array<File>;
private files = [];
private url = "http://localhost:3002/upload";
private dialogCommand;
public encodeBase64:any;
public isContractLocked=false;
private loggedUserName;
private documentType='';
public elfDocIDTemp;
public openFlag = false;
private selectedoptions;
//private fileSelected = false;
private mobilecommand = {
edit: {
createAt: "bottom"
},
group: true,
reorder: true,
resize: true,
sort: true,
autoBind: false,
filter: {
mode: "menu"
},
pager: {
messages: {
display: "Showing {0} to {1} of {2} entries"
}
},
model: {},
columns: [],
pagesize: 50,
getComponentUrl: "jumps/v1/jumps/35355?includes=payments",
postComponentUrl: "jumps/v1/jumps/35355?includes=payments",
excelfileUidName: "ViewPaymentExport",
isLevels: false,
excelFileName: {
fileName: "ViewPaymentExport",
allPages: true
},
contextMenuId: "context-menuAllocation",
navigate: false,
data: "",
mandatoryFields: [],
disableFreeze: true,
searchFields: [],
defaultSort: []
};
constructor(public sportsService : SPORTSService){
}
ngOnInit() {
this.documentType='Contract';
this.privilegeSettings();
let that=this;
this.jumpservice.reloadDocumentEventReceived.subscribe(documents=>{
that.documentType="Contract";
$('.addELFDocumentForm').hide();
that.isDone = true;
that.dragDrop= that.clearBtn;
$("#attachDocumentBrowseBtn").val('');
if(documents.isReLoad){
this.mobilecommand.getComponentUrl='jumps/v1/jumps/'+documents.data+'?includes=documents';//
that.gridmobile.getServiceCall(documents.data);
}else{
that.rowDotMenuClick({"selectedMenuItem":"setData","type":"normalService","data":documents.data});
}
});
this.mobilecommand.model={
id: "documentId",
fields: {
contextRow:{editable:false,filterable:true},
docId:{editable:true,filterable:false,sortable:false},
documentName: { editable: false, nullable: true },
//elfDocID: { editable: false, nullable: true },
elfDocID: {
validation: {
required: true,
digits:true
}
},
url: { editable: false, nullable: true },
documentType: { editable: false, nullable: true },
date: { editable: false, nullable: true }
}
};
this.mobilecommand.columns=[
{
field: "contextRow", width: 25, title:" ",
template:""/*'<span class="contextMenuRow" id="contextMenuRowid"></span>'*//*"<span class='fa fa-file docIcon' id='dcms'></span>"*/
},
{
field: "docId", width: 25, title:" ",sortable:false,
/*template:"<span class='documentIcon displayInlineBlock'></span>"/*,*/
template: function name(model) {
return that.ImageType(model);
},
editor:function (container,model){
that.docTemplateEditor(container,model,that);
}
}
];
}
privilegeSettings():void{
let userPrivilege = this.sportsservice.getUserPrivilege({"parent":"Contract Management","child":"Documents"})
if(userPrivilege == "Full"){
this.isContractLocked = false;
}else{
this.isContractLocked = true;
}
}
running(values):void{
let that = this;
$("#windowcontainer").append(`<div class="allocationViewHistoryPopUpBox">
<div id="viewHistoryPopUpWindow" class="mobilepobUpBox">
<div class="row mobilePopUpHeader">
<div class="mobilePopUpHeaderTitleBox">
<h4 class="">Documents</h4>
</div>
<div class="mobilePopUpHeaderActionsBox">
<button class="clearBtn triggerKPopUpClickViewHistory" type="button" id="closePopup">CLOSE</button>
</div>
</div>
<div class="clearFloat"></div>
<div class="row mobilePopUpGridCollection padBottom0Imp">
<div id="popup-loading"></div>
<div class="col-xs-12 pad0Imp borderHistoryGridTop">
<div id="viewHistoryPopUpGrid" class="kGridStaticFilter"></div>
</div>
<div class="clearFloat"></div>
</div>
<div class="clearFloat"></div>
<label class="commonLink cursorPointer vAlignTop lineHeightInputs" (click)="browseButton()" id="forAttachDocumentBrowseBtn" [class.disabled]="isContractLocked">BROWSE{{browseBtn}}</label>
</div>
</div>`);
let viewHistoryPopUpGrid =[];
that.dataSourceVal = new mobile.data.DataSource({
transport: {
read: function(e) {
e.success(viewHistoryPopUpGrid);
}
},
sort: true,
group: [{field: values.group}]
//ignoreCase: false //<--ignore the casing will stop applying .toLowerCase()
// filter: "gte" //<-- filter operator compliant with `number` type
});
that.MainGrid = {
dataSource: that.dataSourceVal,
reorderable:true,
sortable: true,
filterable: {mode:"row, menu"},
dataBound:function(e){
let gridDataSource = e.sender.dataSource;
console.log('history',e)
if (gridDataSource.group().length > 0) {
$("#collapseBtn123").removeClass('actionDisabled')
}else{
that.toggleCollapse="COLLAPSE ALL";
$('#collapseBtn123').text(that.toggleCollapse);
$("#collapseBtn123").addClass('actionDisabled')
}
},
groupable:true,
editable: false,
columns: values.columns,
pageable:{messages: {display: "Showing {0} to {1} of {2} entries"}},
pageSize:50,
};
that.kPopUpWindowViewHistory = $("#viewHistoryPopUpWindow");
// $("#closePopup").click(function(){
// that.closePopup();
// console.log("click");
// });
// $("#collapseBtn123").click(function(){
// that.collapseBtn();
// });
that.kPopUpWindowViewHistory.mobileWindow({
width: "80%",
title: false,
visible: true,
resizable: false,
actions: false,
draggable: false,
modal: true,
ignoreCase: false, //<--ignore the casing will stop applying .toLowerCase()
filter: "gte", //<-- filter operator compliant with `number` type
open:function(e) {
let windowHeight = $(window).outerHeight();
//let popupHeight = $('.k-widget.k-window').outerHeight();
let popupHeight = 500;
console.log(windowHeight, popupHeight);
if(popupHeight < windowHeight) {
$("html, body").css("overflow", "hidden");
} else {
}
},
close: function(e) {
$("html, body").css("overflow", ""); that.isVisible=false;
},
deactivate: function() {
this.destroy();
console.log("deactivate Call");
}
// closePopup: function() {
// this.kPopUpWindowViewHistory.data("mobileWindow").close();
// }
});
that.kPopUpWindowViewHistory.data("mobileWindow").center();
that.kPopUpWindowViewHistory.data("mobileWindow").open();
$(".k-window").css("top", "15%");
// closePopup(): void {
// //this.isVisible = false;
// this.kPopUpWindowViewHistory.data("mobileWindow").close();
// }
}
}
-MacBook-Pro:webapp Raj$ npm start
> [email protected] start /Users/Raj/Desktop/nbc/webcomponent/src/main/webapp
> tsc && concurrently "npm run tsc:w" "npm run lite"
app/components/skys/sky-documents.ts(129,8): error TS2339: Property 'jumpservice' does not exist on type 'PaperDocuments'.
app/components/skys/sky-documents.ts(140,10): error TS2339: Property 'rowDotMenuClick' does not exist on type 'PaperDocuments'.
app/components/skys/sky-documents.ts(200,23): error TS2339: Property 'ImageType' does not exist on type 'PaperDocuments'.
app/components/skys/sky-documents.ts(203,16): error TS2339: Property 'docTemplateEditor' does not exist on type 'PaperDocuments'.
app/components/skys/sky-documents.ts(211,28): error TS2339: Property 'sportsservice' does not exist on type 'PaperDocuments'.
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] start: `tsc && concurrently "npm run tsc:w" "npm run lite" `
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/Raj/.npm/_logs/2017-07-26T03_44_36_683Z-debug.log
が、それでも同じエラー:( –
あなたがそれらを宣言したwhehter他の変数をチェックする必要があるのと同じ方法。また、きれいにして、アプリケーションを再起動 – Sajeetharan
こんにちは...私はどのような変数を教えていただけますか? –