나는 다음과 같이 정의 된 AngularJS와의 $ 자원을 가지고있다. 나는 메뉴 2를 삭제하는 방법,
<cafe>
<collection href="http://cafe.com/api/menus" type="menus">
<template>
<data name="Name" prompt="Menu name" />
</template>
<items>
<item href="http://cafe.com/api/menus/1">
<link href="http://cafe.com/api/menus/1/ingredients" rel="ingredients" />
<data name="Name" prompt="Menu name">Morning</data>
</item>
<item href="http://cafe.com/api/menus/2">
<link href="http://cafe.com/api/menus/2/ingredients" rel="ingredients" />
<data name="Name" prompt="Menu name">Happy Hour</data>
</item>
</items>
</collection>
</cafe>
질문입니다 : 내가 Menus
에 GET
을 수행 할 때 그래서 나는이 다시 얻을? (자체 하이퍼 미디어 링크가있는 경우 : http://cafe.com/api/menus/2
)
어디서 붙어 있습니까? XML 문서를 JavaScript 데이터 구조로 가져올 수 있습니까? 수정 방법은 확실하지 않습니다. 데이터 구조를 생성 할 수 없습니까? 지금까지 어떤 코드가 있었으며 결과는 무엇입니까? –
나는 ID를 추출하기 위해 JS 객체를 조작하기 시작하지 않을 것이다. 내 코드 주위에 ID가 떠 다니는 것을 원하지 않습니다. 차라리 자체 참조 항목'href'를 사용하여 DELETE 요청을 보냅니다. 나는 각 항목이'resource' 객체 유형인지 궁금합니다. 또는 Angular에서 너무 많이 묻는 것입니까? – Greg
아, "삭제"라고 말하면 HTTP를 통해 서버의 리소스를 삭제하는 것입니다. 필자가 알고있는 한 Angular는 XML을 이해하지 못합니다. 일단 앱에서 약속이 해결되면'console.log'를 통해'Menus'가 무엇입니까? –