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');
-
-
- var listItemInfo = new SP.ListItemCreationInformation();
-
- var listItem = list.addItem(listItemInfo);
-
- 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?