andrewyu0 / anticipate Goto Github PK
View Code? Open in Web Editor NEWSocial posting and voting site for events - anticipate the next exciting thing
Social posting and voting site for events - anticipate the next exciting thing
Keep track of features, next items here
Protocol has to be defined correctly for the links to show. Change this so links without http://
will work
E.g.
As a user I want to be able to post www.espn.com
Currently requires user to input http://www.espn.com
In angularApp.js
, looks like this is working fine:
.state('home', {
url : '/home',
templateUrl : '/home.html',
controller : 'MainCtrl',
resolve : ['postsService', function(postsService){
return postsService.getAll();
}]
})
vs
.state('home', {
url: '/home',
templateUrl: '/home.html',
controller: 'MainCtrl',
resolve: {
postPromise: ['posts', function(posts){
return posts.getAll();
}]
}
})
without having to inject postPromise
into the controller. Look into whether or not this is ok
Revisit the route structure in anticipate/routes/index.js
in commit 2b45a51, particularly router.param('post', function(){})
Refactor the way routes with url params are getting called
Implementing views and templates in HTML for now
This works fine:
state:
.state('posts', {
...
resolve : ['$stateParams','postsService', function($stateParams, postsService){
return postsService.getOne($stateParams.id)
}]
});
postsService.getOne:
output.getOne = function(postId){
return $http.get('/posts/' + postId).success(function(currentPost){
output.currentPost = currentPost;
});
};
in PostsCtrl:
$scope.post = postsService.currentPost;
However, in order to use a named resolve, and inject that resolve in the controller, the state/service needs to be formatted as such:
State:
resolve : {
currentPost : ['$stateParams','postsService', function($stateParams, postsService){
return postsService.getOne($stateParams.id)
}]
}
postsService.getOne
output.getOne = function(postId){
return $http.get('/posts/' + postId).then(function(res){
return res.data;
});
};
In order to do the following in the controller:
app.controller('PostsCtrl', [
'$scope',
'currentPost',
function($scope, currentPost){
$scope.post = currentPost
}]);
Not sure why... I have a feeling it has to do with the res
thats coming back from the GET, it's still in the req/res paradigm, which I think I had to use then()
vs success()
. Check out a resource like this: To then() or to success() in AngularJS
Action item : Create new branch and experiment
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.