You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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
The text was updated successfully, but these errors were encountered: