templateUrl의 경로를 별도의 .jade 파일로 지정하고 싶습니다. 그러나 500 err 및 Error : [$ compile : tpload] 표시 됩니다.
아래는 내 지시문의 코드입니다.
app.directive('personRecord',['$http',function(http){
return{
restrict : 'AE',
templateUrl : '../../views/template.jade',
link : function(scope,ele,attr){
}
}
}]);
내 폴더 구조는 다음과 같습니다.
bin
node_modules
public
|-- js
|-- main.js
routes
views
|-- template.jade
|-- index.jade
app.js
package.json
제발 도와주세요! 내가 여기서 무엇을 놓치고 있는가!
내 제안은 공용 폴더 안에보기 폴더를 넣는 것입니다.
bin
node_modules
public
|-- js
| |-- main.js
|--views
|-- template.jade
|-- index.jade
routes
app.js
package.json
그런 다음
app.directive('personRecord', function(http){
return {
restrict : 'AE',
templateUrl : 'views/template.jade',
link : function(scope, ele, attr){
}
};
});
도움이되기를 바랍니다 :)
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다