I'm getting an error that I've Googled a bunch and I'm getting nowhere. Here's the code:
VF Page:
<apex:page controller="registrationController" showHeader="false" sidebar="false" standardStylesheets="false" docType="html-5.0" >
<apex:remoteObjects>
<apex:remoteObjectModel name="Volunteer_Visit__c" jsShorthand="VisitGateway" fields="Id,Name"></apex:remoteObjectModel>
<apex:remoteObjectModel name="Volunteer_Registration__c" jsShorthand="RegGateway" fields="Id,Name,Contact_Org_Name__c,Contact_First_Name__c,Con_Email__c,Schedule_Start_Time__c,Org_ID__c,Volunteer_Visit__c,Contact__c,Walk_in__c,Badge_Name__c,Num_of_Hours__c"></apex:remoteObjectModel>
</apex:remoteObjects>
<head>
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta name="description" content=""/>
<meta name="author" content=""/>
<!-- Boostrap loaded in from the MaxCDN and some custom bootstrap styles hacked together from this template
http://ironsummitmedia.github.io/startbootstrap-stylish-portfolio/ along with some custom flavor -->
<apex:stylesheet value="{!URLFOR($Resource.registrationappstatic, 'registrationapp/styles/stylish-portfolio.css')}"/>
<apex:stylesheet value="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css"/>
<!-- Font Awesome stuff also coming in from the Stylish Portfolio theme -->
<apex:stylesheet value="{!URLFOR($Resource.registrationappstatic, 'registrationapp/font-awesome/css/font-awesome.min.css')}"/>
<link href="//fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,700,300italic,400italic,700italic" rel="stylesheet" type="text/css"/>
<!-- Good ol' Angular JS and ngRoute loaded in from Google CDN -->
<apex:includeScript value="//ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"/>
<apex:includeScript value="//ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular-route.min.js"/>
<!-- Custom AppJS here and controllers found in the registrationappstatic Static Resource -->
<apex:includeScript value="{!URLFOR($Resource.registrationappstatic, 'registrationapp/app.js')}"/>
<apex:includeScript value="{!URLFOR($Resource.registrationappstatic, 'registrationapp/registration-list-controller.js')}"/>
</head>
<body>
<div class="bootstrap" ng-app="registrationKiosk">
<div ng-view="ng-view"></div>
</div>
<apex:includeScript value="//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"/>
<apex:includeScript value="//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"/>
</body>
Here's app.js
angular
.module('registrationKiosk', ['ngRoute'])
.constant('resourceUrl', '/resource/'+Date.now()+'/registrationappstatic/registrationapp/app')
.config(['$routeProvider', 'resourceUrl', function($routeProvider, resourceUrl) {
$routeProvider
.when('/', {
templateUrl: resourceUrl+'/view1.html'
})
.when('/volunteer-select', {
templateUrl: resourceUrl+'/view2.html',
controller: 'RegCtrl'
})
.when('/preregister', {
templateUrl: resourceUrl+'/view3.html',
controller: 'RegCtrl'
})
.otherwise({
redirectTo: "/"
});
}])
.service('visitStorage', SObjectModel.VisitGateway);
Note the service bit - this is where I think things are going awry. Here's how I set up the one controller I have:
.controller("RegCtrl", ["$scope", "$q", "visitStorage", function($scope, $q, visitStorage) {
So I have all this set up and I'm running into the unknown provider error for this service. What am I doing wrong? If I'm not showing enough code - please let me know. I'm also getting this error:
Uncaught ReferenceError: SObjectModel is not defined
I assume it's related to the service - but I don't know what I'm doing wrong.
Thanks!