As a reasonably new developer I don't really have much knowledge when it comes to this. I am attempting to use angularjs inside a in my HTML.
Here is my current code:
<div class="contentContainer" ng-controller="sectionController">
<div id="sectionContainer" ng-repeat="section in sections">
<div id="section{{ section.id }}">
<h3 class="sectionTitle">{{ section.title }}</h3>
<script>
$('.link1').click(function(event){
$('#section1').scrollView();
});
$.ajax({
url : '../src/text/section1.txt',
dataType: 'text',
success : function (data) {
$('#section1').append(data);
},
});
</script>
</div>
</div>
</div>
And I would like it to do something like this:
<div class="contentContainer" ng-controller="sectionController">
<div id="sectionContainer" ng-repeat="section in sections">
<div id="section{{ section.id }}">
<h3 class="sectionTitle">{{ section.title }}</h3>
<script>
$('.link{{ section.id }}').click(function(event){
$('#section{{ section.id }}').scrollView();
});
$.ajax({
url : '../src/text/section{{ section.id }}.txt',
dataType: 'text',
success : function (data) {
$('#section{{ section.id }}').append(data);
},
});
</script>
</div>
</div>
</div>
Is this possible or will I just have to copy out the same code for each section of the page.
Thanks in Advance