Tech
Forums
Jobs
Books
Events
Videos
Conference
Annual Conference
Bcrypt
Ai Conference
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Post
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
1
Reply
Loading the list item details using angular js.
Rinu
6 years ago
261
Reply
Hi all,
I am new to angular JS and was able to create a form to submit the data to the list . Using the below code.
<script src=
"//ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js"
></script>
<script>
window.onload =
function
() {
alert(
'page'
);
};
function
ContactsCtrl($scope) {
$scope.contact = { firstName:
""
, lastName:
""
, Location:
""
, Departmant:
""
};
$scope.addContact =
function
($event) {
var
x = $scope.contact;
$event.preventDefault();
if
(x.Departmant ==
"HR"
) {
alert(
'pease select IT'
);
}
else
{
var
clientContext =
new
SP.ClientContext.get_current();
var
web = clientContext.get_web();
var
list = web.get_lists().getByTitle(
'Contact Details'
);
// create the ListItemInformational object
var
listItemInfo =
new
SP.ListItemCreationInformation();
// add the item to the list
var
listItem = list.addItem(listItemInfo);
// Assign Values for fields
listItem.set_item(
'Title'
, x.firstName);
listItem.set_item(
'firstName'
, x.firstName);
listItem.set_item(
'lastName'
, x.lastName);
listItem.set_item(
'fullName'
, x.firstName +
" "
+ x.lastName);
listItem.set_item(
'Location'
, x.Location);
listItem.set_item(
'Departmant'
, x.Departmant);
listItem.update();
clientContext.executeQueryAsync(
Function.createDelegate(
this
, onQuerySucceeded),
Function.createDelegate(
this
, onQueryFailed)
);
}
};
onQuerySucceeded =
function
() {
alert(
'Successfully updated the contact'
);
}
onQueryFailed =
function
(sender, args) {
alert(
'Request failed. '
+ args.get_message() +
'\n'
+ args.get_stackTrace());
}
}
</script>
i would know if there is a way to show an item details from the list to an angular js form just like above?.
The senario is that A sharepoint designer workflow email is to be sent to the users who will then click on the link to access see or edit the list item. How do i do that?
Post
Reset
Cancel
Answers (
1
)
Next Recommended Forum
Is there a way using PowerShell or CSOM to disable Delve
SharePoint search Service on SharePoint 2013 foundation