이 문제는 angular.js에 paper.js를 통합 할 때 발생합니다. 내 문제는 필자가 paperscript 부분을로드 할 위치를 알지 못한다는 것이다.angular.js에 paper.js 통합
나는보기와 컨트롤러가 있으며 실제로 컨트롤러에 코드를 놓을 수는 없으며 뷰에 배치하면로드되지 않습니다. 이 같은
내 컨트롤러의 모양을
var hash = window.location.hash.split('/');
$scope.status = 'Loading';
var request = jQuery.ajax(system.server, {
'url': system.server,
'headers': {
'Accept': 'application/json',
'Request': system.request + '/hcbs/allocations/resident/' + hash[3],
'Username': system.username,
'Password': system.password
}
})
.always(function(response)
{
signature.constructor();
switch(response.status)
{
case 200:
case undefined:
$scope.$apply(function()
{
$scope.status = '';
var res = JSON.parse(response);
$scope.hcbsAllocations = res.hcbsServiceAllocations;
$scope.change = function(allocationId)
{
console.log(jQuery('[data='+ allocationId +'][name=startDate]').val());
console.log(jQuery('[data='+ allocationId +'][name=endDate]').val());
}
$scope.submit = function(allocationId)
{
// Validate dates
// Make signature popup
$scope.signaturePop = true;
}
});
break;
case 404:
console.log('error ' + response.status);
$scope.$apply(function()
{
$scope.status = 'Problems loading ressource at the moment';
});
default:
console.log(response);
}
});
내보기는 다음과 같습니다가 :
<div id="app-content">
<div consumer />
<h1>Consumer</h1>
<div ng-show="status">
<div class="notice">
<p>{{status}}</p>
</div>
</div>
<form name="attendance">
<table class="hcbs">
<tr ng-repeat="allocation in hcbsAllocations">
<td class="first"><h3>{{allocation.type}}</h3></td>
<td class="middle">
<input type="datetime-local" name="startDate" ng-model="startDate" ng-change="change(allocation.id)" data="{{allocation.id}}" placeholder="Choose start date" />
<input type="datetime-local" name="endDate" ng-model="endDate" ng-change="change(allocation.id)" data="{{allocation.id}}" placeholder="Choose end date" />
</td>
<td class="last">
<span class="btn" class="submit" data="{{allocation.id}}" ng-click="submit(allocation.id)"><i class="icon-ok icon-large"></i></span>
</td>
</tr>
</table>
</form>
</div>
우리가 onFrame 방법을 사용할 수 있습니다
jsFiddle
난 그냥이 같은
그리고 간단한 지시를 가정 내 요소가? – ratata
ok ... 추가 ---> paper.view.onFrame = onFrame; initPaper 함수가 작동합니다. – ratata