2016-07-12 5 views
0

nativescript에서 datepicker 모달 선택 라이브러리를 만듭니다.nativescript : 모달 속성이 정의되지 않았습니다.

var pagesModule = require("ui/page"); 
var datePickerModule = require("ui/date-picker"); 
var moment = require('momentjs'); 
var frame = require('ui/frame'); 

module.exports.init = function(tarih, callBack) { 
    var dt = new datePickerModule.DatePicker(); 
    var page = new pagesModule.Page(); 
    page.content = dt; 
    page.height = 250; 
    var parent = frame.topmost().currentPage; 
    parent.modal.showModal(page, '', function() { 
     callBack(); 
    }); 
}; 

메인 js 파일에서이 라이브러리를 호출하고 있습니다.

var dm = require('../../../lib/dateModal'); 
exports.tarihCagir = function(nesne) { 
    dm.init('', function() { 
     console.log('kapatıldı'); 
    }); 
}; 

이 오류가 발생합니다. 'TypeError : 정의되지 않은'showModal '속성을 읽을 수 없습니다.

이 문제는 복잡하지 않을 수 있지만 nativescript는 초보자입니다.

+0

문제가 해결되었습니다. parent.modal.showModal 코드를 parent.showModal로 변경했습니다. –

+0

질문에 대한 답변을 게시해야합니다. =) – evolutionxbox

+0

감사합니다. 대답을 추가하십시오. –

답변

2

문제가 해결되었습니다. parent.modal.showModal 코드를 parent.showModal로 변경했습니다.

관련 문제