0

I am trying to switch views from one page to another when a button is pressed.I am using ng-click for it but it doesnt switch the views when the button is pressed

.js file

$scope.onCreateAppointment = function () {

              $scope.templates.myTemplate = "views/calendar.html";

            };

        }]);

.html file

    ng-click="OnCreateAppointment()">Create Appointment</button>

1 Answer 1

2

Javascript is case sensitive. The method "OnCreateAppointment()" doesn't exist on the scope.

The fix is:

 <button ng-click="onCreateAppointment()">Create Appointment</button>
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.