Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

angular.js:9037 ReferenceError: $newPost is not defined #24

Open
sarit-lubu opened this issue May 2, 2016 · 0 comments
Open

angular.js:9037 ReferenceError: $newPost is not defined #24

sarit-lubu opened this issue May 2, 2016 · 0 comments

Comments

@sarit-lubu
Copy link

sarit-lubu commented May 2, 2016

newPost isn't defined as a result ng-repeat='post in posts isn't working in main.html (see below).
i've defined everything exactly as you have described.
/mainController in chirpApp.js/
app.controller('mainController' , function($scope){
$scope.posts = [];
$scope.newPost = {created_by:'' ,text:'' ,created_at:'' };
$scope.post = function (){
$scope.newPost.created_at = Date.now();
$scope.posts.push($scope,$newPost);
$scope.newPost = {created_by:'' , text:'' ,created_at:''};
};
});

below is my html code in main.html
capture

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant