Hidden field with value not being passed to controller - Ionic
<p>working on image uploads with Ionic.</p>

<p>When testing my api post with postman it works great, but couldnt get it working with my app.</p>

<p>Trying to debug, I added this to my form:</p>

<pre><code>&lt;input type="hidden" ng-model="projectData.imageBase64" value="testvalue"&gt;
</code></pre>

<p>And then in my controller:</p>

<pre><code>$scope.projectData = {};
$scope.storeProject = function(projectData) {

    $http.post('http://api.com/api/v1/projects', {
        title: projectData.title,
        image: projectData.imageBase64,
        user_id: $rootScope.currentUser.id
    }).success(function(response) {
        console.log(response);
    }).error(function(response){
        console.log(response);
    });

};
</code></pre>

<p>The response from my API (Laravel) is just returning back all the request data asj JSON.</p>

<p>What this returns is no value or record of the image value being passed through.</p>

<p>If I instead change the hidden field to a text field and manually type something then post the form, it is returned back as having input in the request.</p>

<p>Where am I going wrong?</p>

<p>Note: In the form is:</p>

<pre><code>&lt;form ng-submit="storeProject(projectData)"&gt;
        &lt;div class="list"&gt;
            &lt;label class="item item-input item-stacked-label"&gt;
                &lt;span class="input-label"&gt;Name&lt;/span&gt;
                &lt;input type="text" placeholder="Enter a project name" ng-model="projectData.title"&gt;
            &lt;/label&gt;

            &lt;input type="hidden" ng-model="projectData.imageBase64" value="ddd"&gt;

            &lt;label class="item"&gt;
                &lt;button class="button button-block button-positive" type="submit"&gt;Create Project&lt;/button&gt;
            &lt;/label&gt;
        &lt;/div&gt;
    &lt;/form&gt;
</code></pre>

<p>And the title gets passed through fine.</p>