Click here to Skip to main content
15,921,463 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Im trying to bind data to angular view but i'm getting error in angular js reference.
Stating that No Module "myApp".
Here is My code:
"use strict";
(function(){
var app=angular.module('myApp',[]).controller('ExampleCtrl',['$scope','$location', function($scope,$location){
var NHRID=$location.search().nhrid;
NHRID=JSON.parse(NHRID);


//===============get all controls from the list================================================
var data1;
$.ajax({
url:_spPageContextInfo.webAbsoluteUrl+"/_api/web/lists/GetByTitle('CandidateIndia')/items?$filter=NHRID eq '"+ NHRID+"'",
method: "GET",
headers: { "Accept": "application/json; odata=verbose" },
success: function (data)
{
data1=data.d.results;



$scope.data=data1[0];
$scope.data.Siblings=JSON.parse($scope.data.Siblings);
$scope.data.FamilyDetails=JSON.parse($scope.data.FamilyDetails);
$scope.items=JSON.parse($scope.data.EmploymentDetails);
$scope.data.EducationalDetails=JSON.parse($scope.data.EducationalDetails);


},
error: function ajaxError(response) {
alert(response.status + ' ' + response.statusText);
}


});
View Code:<
script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script>


What I have tried:

I tried of placing angularjs reference link in first.
also specified ng-app,ng-controller.
Posted
Comments
Konstantin A. Magg 25-Feb-16 16:35pm    
Hi there, what is the precise error message you receive? And how does your view code look like?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900