-3

I am trying to develop a responsive web view. In this html source, I am using angular js. I am trying to call a function from html source.

2
  • What error are you getting? Commented Mar 8, 2017 at 6:21
  • you dont have any function you just have definition of controller Commented Mar 8, 2017 at 6:21

2 Answers 2

0

The problem is that you are using C# in an JavaScript file. Angularjs is based on JavaScript and the code in app.js should be JavaScript.

Read about Angularjs here

Sign up to request clarification or add additional context in comments.

Comments

0

You are not making any route in your code to use that controller in.

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

app.config(function($routeProvider) {
  $routeProvider
    .when('/', {
      templateUrl: "pages/home.html",
      controller: "HomeController"
    })

    .otherwise({
      redirectTo: '/'
    })

});

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.