Hi Anurag,
For the first part of your problem, you can simply use ng-repeat on your
json data to populate your table with the same. Then use dropdown to filter
the that data accordingly. One such example is
<select (dropdown for your teams) ng-model=team_home>
<select (dropdown for your year) ng-model=year>
<tr (in your table) ng-repeat="j in json_data | filter : {team1 :
team_home, date : year}">
For your second part, you can a ng-click to your match name to call a
function. This function will extract details from your original json_data
for that match and put it in a new object. Use this new object to display
you required details.
Same goes for your third part only this time filter your results according
to the team name and put it in a new object.
Regrads,
Hardik
On Saturday, May 6, 2017 at 10:24:15 AM UTC+5:30, Anurag Sharma wrote:
>
> Hi Team,
> I am new to the AngularJS world and i have just started developing SPA's
> using AngularJS. I have a project where i have to fetch data in json form
> from an api and display it on an html page using AngularJS 1.x. The data is
> of football matches in 2015 and 16.
>
> https://raw.githubusercontent.com/openfootball/football.json/master/2015-16/en.1.json
>
> https://raw.githubusercontent.com/openfootball/football.json/master/2016-17/en.1.json
>
> Th things i have to do is
>
> - A view to display all matches held with filters like filter by year,
> team name, score
> - view to display details of a single match
> - view to display team wise match statistics like total matches
> played, total won etc.
>
> I can picture my site with a data in a table but cant make out what should
> be the table structure of this json. can someone help me out? like how many
> and columns with what header?
>
--
You received this message because you are subscribed to the Google Groups
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.