Not able to add ng-controller to ion-view-model

I have a signup template/view written using ionic framework but whenever I submit the Signup form the value of ng-model $scope.account remains Undefined. According to me the main reason for this is that I am not able add controller name (SingupController) in signup.html. Whenever I add ng-controller=“SingupController” and run the app browser get closed with a message “Unable to attache. Operation is timeout”

I am using Visual Studio 2013, AngularJS, Ionic and Adobe PhoneGap.

Here is a is the code which I am using.


    <button class="button" ng-click="closeSignup()">Cancel</button>
    <h1 class="title">Sign up</h1>

<ion-content ng-controller="SignupController">
    <form ng-submit="doSignup()">
        <div class="list list-inset">

            <label class="item item-input">
                <input type="text" placeholder="First Name" ng-model="account.firstName">

            <label class="item item-input">
                <input type="text" placeholder="Last Name" ng-model="account.lastName">

            <label class="item item-input">
                <input type="email" placeholder="Email" ng-model="">

            <label class="item item-input">
                <input type="text" placeholder="School" ng-model="">

            <label class="item item-input">
                <input type="text" placeholder="Country" ng-model="">
        <div class="list list-inset">
            <label class="item item-input">
                <input type="password" placeholder="Password" ng-model="account.password">

            <label class="item item-input">
                <input type="password" placeholder="Confirm Password" ng-model="account.confirmPassword">
            <p>Minimum 8 characters a-Z, 0-9</p>

        <label class="item">
            <input type="submit" class="button button-block button-balanced" value="Sign up" />


And my controller code in controller.js is as follows:

angular.module('angularApp.controllers', [])

.controller('SignupController', ['$scope', '$ionicModal', '$timeout', '$http', function ($scope, $ionicModal, $timeout, $http) {
    // Form data for the login modal

    // $scope.signupData = {};

    // Create the signup modal that we will use later
    $ionicModal.fromTemplateUrl('templates/signup.html', {
        scope: $scope
    }).then(function (modal) {
        $scope.modal = modal;

    // Triggered in the signup modal to close it
    $scope.closeSignup = function () {

    // Open the signup modal
    $scope.signup = function () {
    $scope.doSignup = function () {

        var config = {
            method: "POST",
            url: "http://localhost:60923/api/account/",
            data: $scope.account
        $http(config).success(function (data) {
            $scope.mydate = data;


I am really not sure where the problem is? Please advice me if you see any problem inside my code. Thanks in advance.

a form gets its own scope, and you not initialize your account object in your controller. so the account-object is only visible in the form.


$scope.account = {};

to your controller and it should work

I have added $scope.account = {}; but still facing the same problem.

I was facing the same situation.
This thing was driving me insane…

then after a whole wasted day I just discovered this:

and I started banging my head against the wall… :astonished:

to cut it short, the problem (which is not really a problem if u look to it in another perspective) is the fact that
when you set an

<input type="email" ng-model="" />

you are suggesting to angular that you want that field to be evaluated as an email.
So if the field is not evaluated correctly ( means, you are not providing a valid email address), then angular will keep passing you undefined values…

a live example

hope this could help u cope w/ ur troubles.

Happy Coding!