i'm beginner with AngularJS but i have a problem in it and i dont know how to fix it.
i will explain it to you ,
I have OneToMany relationship between a table called "Reference" and "Critere" it means that one "Reference" should contains many "criteres" so i listed all the "References" in a table.
the main problem comes to when i clik on "Reference" it should redirect me to a page called "Critere" with the id of "Reference" cliked on it, and that page "Critere" (Critere/idReference) will contains all the Criteres that are related to that "Reference". Knowing that i got all the data in Json format i'm working with Spring Boot and Rest Api , i don't have any problem in Spring cause when i try to load all the "Criteres" related to that "References" it happens but i don't know how to do it with AngularJs.
Here's My code :
<tr class="clickable-row" ng-init="chargerNoteReference(reference.idReference)" data-ng-click="redirectt(reference.idReference)">
<td>{{reference.titleReference}}</td>
</tr>
here i load all the References listed on a table with a clickable row
i use one controller
$scope.redirectt = function(x){
$window.location.assign("/Critere/"+x);
}
i got Also the route Params
var app = angular.module("Entourage",['ngRoute']);
app.config(function($routeProvider ){
$routeProvider
.when('/Critere/:idReference',{
templateUrl: 'templates/Critere.html',
controller : "EntourageController",
})
})
Here is the function that i called in the Files Critere
$scope.redirect = function(){
$scope.Critere={}
$http.get("/references/criteres/"+$scope.idReference+"/"+$scope.idUser)
.success(function(data){
$scope.Critere=data
});
};
and here's my file Critere
<tbody ng-repeat="critere in Critere">
<tr class="odd gradeX" >
<td class="center" >{{critere.idCritere }}</td>
<td class="center">{{critere.descriptionCritere }}</td>
<td class="center"> {{critere.vue}}</td>
</tr>
</tbody>
i got also this error :
Uncaught Error: [$injector:modulerr] and i'm using thymeleaf
<script th:src="@{https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular-route.js}"></script> <script th:src="@{https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular.min.js}"></script> <script th:src="@{https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular.js}"></script>