I've been doing some digging to figure out how I can get ui-router to work. I came across this:
How can I reference angularjs template files within a visualforce page?
but every answer on there didn't work for me.
Here's the VF page:
<apex:page standardStylesheets="false" sidebar="false" showHeader="false" docType="html-5.0">
<apex:stylesheet value="{!URLFOR($Resource.QuarryResources, 'app/css/style.css')}" />
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<html ng-app="quarryApp">
<head>
<meta charset="utf-8"></meta>
<meta http-equiv="X-UA-Compatible" content="IE=edge"></meta>
<meta name="description" content=""></meta>
<meta name="viewport" content="width=device-width, initial-scale=1"></meta>
<link href="https://netdna.bootstrapcdn.com/font-awesome/2.0/css/font-awesome.css"></link>
<base href="{!URLFOR($Resource.QuarryResources, 'app/')}" />
<script src="//cdnjs.cloudflare.com/ajax/libs/angular-ui-router/0.2.10/angular-ui-router.min.js"></script>
<!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
</head>
<body ng-app="quarryApp">
I've uploaded the related resources as a .zip in the Static Resources of my sandbox; here's the structure:
QuarryResources.zip
- app
- css
- images
- script
- pages
Here's what a sample partial loos like:
<section class = "main-wrapper">
<header ng-model="message">
<h1>Home</h1>
</header>
</section>
Controller for QuarryApp:
var quarryApp = angular.module('quarryApp', ['ui.router'])
.config(function($stateProvider, $urlRouterProvider) {
$urlRouterProvider.otherwise('/home');
$stateProvider
.state('home', {
url:'/home',
templateUrl: "pages/home.html"
});
});
If possible, I'd like to go down the route of storing the partials as a static resource rather than as visualforce pages. My research has shown that the performance is much faster that way; of course, correct me if I'm wrong.
Any help would be much appreciated by this new VF and Angular developer.
Regards, W