My app is using Yeoman, AngularJS. I'm fairly new to it and so this questions is regarding managing data. Currently I am hard coding my data into an array of JSON object in my main.js file as such

angular.module('myApp')
.controller('AdminCtrl', ['$scope', '$filter', function($scope, $filter) {
    //<--ARRAY OF DATA with multiple attributes<--
    $scope.campaigns = [
    { name:'', description'', etc... etc...},
    {...Lots of Data...},
    {...Lots of Data...},
    {...Lots of Data...},
    {...Lots of Data...},
    ];
}]);

I am already deploying the site via heroku and so I wanted to upload this data into the starter dev Heroku Postgres Database. This is my first time uploading data to the heroku database and was wondering how I would go about this process. I want to use Node.js (also new for me) and I found this article (https://devcenter.heroku.com/articles/heroku-postgresql#connecting-in-node-js) but is this all I have to do? Where and how do I transfer my current array data into Node.js and then upload it to heroku?


Edit: I followed the http://www.sitepoint.com/deploying-yeomanangular-app-heroku/, and http://www.lars-schenk.com/deploying-a-yeoman-angular-app-to-heroku/1661 articles (basically the same it seems) that @montecruiseto suggested and did a "grunt build" but the data is still lost when I refresh the page. This is my first time using Node.js but I believe these examples are deploying a static angular app without dynamic data update. What are the steps I need to take to take my current array data and utilize the "web.js" to make it persist up in the Heroku database?

share|improve this question

Why not run the Yeoman-Heroku generator over your existing app? Should take you a long step towards successful deployment.

Either way, this is pretty well documented for yo angular:

share|improve this answer
    
Thank you for the resources. I followed the Deploying a Yeoman/Angular app to Heroku, and Deploying a Yeoman + Angular app to Heroku links (basically the same it seems) and did a "grunt build" but the data is still lost when I refresh the page. I think it is because those are deploying a static angular app without dynamic data update. How do I take my current array data and utilize the "web.js" to make it persist? – stcho Jul 25 '14 at 15:41

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.