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.

1 Answer 1

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.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.