Skip to content

Instantly share code, notes, and snippets.

rePassante

Block or report user

Report or block rePassante

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@rePassante
rePassante / main
Created Jun 3, 2013
AngularJS - Shared Data Services & Handling Page Refreshes
View main
<!-- Check For Customer Data In sharedData -->
if (sharedData.getNewlyAddedCustomer() != null) {
<!-- The Data Exists In sharedData, add it to $scope and Proceed Normally -->
$scope.newlyAddedCustomerRequest = sharedData.getNewlyAddedCustomerRequest();
} else {
<!-- The Data DOES NOT Exist In sharedData, Let's check the hash and see if we can re-fetch -->
var path = $location.path();
var splitPath = path.split("/");
<!-- When we eval our split path we can eval to see if we have info after the route
if (splitPath.length > 2) {
@rePassante
rePassante / controllers.js
Last active Dec 18, 2015
Polling In AngularJS
View controllers.js
$scope.startPolling = function () {
$scope.isPolling = true;
$scope.pollCount = 60;
$scope.keepPolling();
};
$scope.stopPolling = function () {
$scope.isPolling = false;
$scope.pollCount = 60;
};
You can’t perform that action at this time.