Pass parameter from angular controller to resource and the api controller
Hi
First time I have had to actually build something with angular and I have hit a roadblock, how do I pass a parameter from controller to resource and then api controller.
I currently have:
Controller:
angular.module("umbraco").controller("My.SendNewsLettersController", function ($scope, sendNewsLettersResource, $http) {
"use strict";
var vm = this;
vm.date = "";
vm.config = {
enableTime: false,
dateFormat: "d-m-Y ",
time_24hr: false
};
vm.datePickerChange = datePickerChange;
var dateSelected = "";
function datePickerChange(selectedDates, dateStr, instance) {
dateSelected = dateStr;
}
vm.clickButton = clickButton;
function clickButton() {
//Pass date from datepicker
sendNewsLettersResource.newsLetters(dateSelected).then(function(response) {
alert(response.data);
});
}
Pass parameter from angular controller to resource and the api controller
Hi
First time I have had to actually build something with angular and I have hit a roadblock, how do I pass a parameter from controller to resource and then api controller.
I currently have:
Controller:
});
Then resource
});
FInally API controller
Figured it out
});
is working on a reply...