나는 다음과 같은 각도 및 HTML 파일이 있습니다데이터를 전달
var app = angular.module("directiveApp", [])
app.directive("directiveone", function(){
\t return{
\t \t restrict: "E",
\t \t template:'<div><input type="text" ng-model="textOne"></div>'
\t };
});
app.directive("directivetwo", function(){
\t return{
\t \t restrict: "E",
\t \t template:'<div><input type="text" ng-model="textTwo"></div>'
\t };
});
app.directive("directivethree", function(){
\t //display textOne and textTwo in the template of this directive.
})
<!doctype html>
<html ng-app="directiveApp">
<head>
\t <script src = "http://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular.min.js"></script>
\t \t <script src = "directiveApp.js"></script>
</head>
<body>
<directiveone></directiveone>
<directivetwo></directivetwo>
</body>
</html>
내가 NG-모델 textOne 및 textTwo에 삽입 된 값을 인쇄 할을 directivethree를 사용합니다. 이 두 지시어의 데이터를 전달하고 인쇄 할 수 있습니까? 당신의 지시어는 범위를 가지고 있겠지 때문에
제안 해 주셔서 감사합니다. 코드의 출력 결과는 { "a": "textBox1", "b": "textBox2"}와 유사합니다. 텍스트 상자에 입력 된 값이 아닌 관련 객체를 jus에 인쇄 할 수 있습니까? – Anvith
그것을 알아 냈어 .. 고마워. :) – Anvith