0

I am new to angularJs, while using routeProvider angularJs through following error. I tried everything but I did not found an solution.

Errors:

Error: Argument 'fn' is not a function, got string from viewApp
TypeError: angular.$$minErr is not a function

Here is my html file

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src="angular.min.js" language="javascript" type="application/javascript"></script>
<script src="angular-route.js"></script>
<script src="custom.js"></script>
<title>Anguler App</title>
</head>
<body ng-app="viewApp">
<a href="#/click">Home</a>
    <div ng-view>

    </div>
</body>
</html>

AngularJs code that I am using.

var myapp=angular.module('viewApp',[]);
myapp.config(['$routeProvider',function($routeProvider){
        $routeProvider.when("/click",{
            templateUrl:"partialview.html"
            }).otherwise({
        redirectTo: '/'
      });
    }]);

1 Answer 1

1

You've linked the angular-route.js but not using it in your app. Do a dependency injection -

var myapp=angular.module('viewApp',['ngRoute']);
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.