그래서 사용자가 어떤 questionNumber에 있는지에 따라 동적으로 #panel div에로드되는 html이 있습니다. 이것은 모든 코드가 아니라 내가 생각하는 모든 관련 코드입니다. 어쨌든 <input>
get이 페이지에로드되지만 실제로 아무 것도 수행하지 않습니다. 나는 무엇을 여기에서 놓치고 있냐? 당신이 DOM에 HTML을 추가하면 바인더 제본 변수 단지 등 {{variable}}
동적으로로드 된 입력 상자에는 아무런 변화가 없습니다
var readingController = function (scope, Romanize){
scope.usersRomanization;
//alert(scope.usersRomanization);
}
var app = angular.module('Tutorials', ['functions', 'tutorials']).controller('getAnswers', function ($scope, $element, Position, Romanize) {
$scope.sectionNumber = Position.sectionNumber;
if ($scope.sectionNumber === 0){
$('#panel').html('<div ng-controller="readingController"><input ng-model="usersRomanization"></input></div>');
readingController($scope, Romanize);
}
<body ng-controller="getAnswers">
<div id="panel">
</div>
</body>
컨트롤러에 jQuery를 사용할 수 없습니다. [jQuery 배경이있는 경우 [AngularJS에서 어떻게 생각합니까?] (http://stackoverflow.com/questions/14994391/how-do-i-think-in-angularjs-if-i-have-a)를 참조하십시오. -jquery-background). – Stewie
그런 다음 어떻게이 HTML을 questionNumber를 기반으로 페이지에로드해야합니까? 이것이 기술적으로 작동하지 않아야한다는 규칙에도 불구하고 사실에도 불구하고? – Tules