2

I am trying to use AngularJs routing in Visualforce page. I have my file structure as mentioned below: -AngularApp (static resource) -app ---controllers ---directives ---services ---views --app.js

I want to direct user on a button click, all .html files are in views folder

In app.js, i have written:

var app = angular.module('workOrderApp',['ngRoute']);

app.config(['$routeProvider',function($routeProvider) 
{       


$routeProvider


             // route for the home page by default
            .when('/', {
                templateUrl : 'views/createWorkOrder.html',
                controller  : 'woFormController'
            })             
            // route for the work order grid page.
            .when('/getWorkOrder', {
                templateUrl : 'views/workOrderGrid.html',
                controller  : 'searchWOController'
            }).
            otherwise({
                redirectTo: '/'
            });

}]);

In VF page i have written:

<apex:includeScript value="{!URLFOR($Resource.AngularJSLib, 'angular.min.js')}"/>
<apex:includeScript value="{!URLFOR($Resource.AngularJSLib, 'angular-route.min.js')}"/>
<base href="{!URLFOR($Resource.AngularApp, 'app/')}" /> 



<div ng-app="workOrderApp"  class="container" width="100%">        
        <ng-view></ng-view>
    </div>

After redirection i am able to view the page, but it is give an alert saying: Invalid criteria specified for retrieval.

ValidationError [code=11, message=Data does not match any schemas from "oneOf", path=/where, schemaKey=null]

How can i resolve this issue. Please help.

2

I resolved it by redirecting it from a button, actually i was trying to enter the url manually giving a '/#' tag in url.I guess thats may be the issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.