Home Reference Source Repository
public class | source

CourseList

Extends:

react~Component → CourseList

Constructor Summary

Public Constructor
public

constructor(props: *)

constuctor of courseList

Member Summary

Public Members
public

state: *

Method Summary

Public Methods
public

Called dom elements is mounted, set focus on search bar

public

called before dom elements is mounted, fetch course

public

converts json object to an array of its contents

public

render(): html

renders the display for the current page.

public

saveACourse(courseName: object)

save a course

public

update search term after user imput

Public Constructors

public constructor(props: *) source

constuctor of courseList

Params:

NameTypeAttributeDescription
props *

Public Members

public state: * source

Public Methods

public componentDidMount() source

Called dom elements is mounted, set focus on search bar

public componentWillMount() source

called before dom elements is mounted, fetch course

public jsonToArray(json: object): Array source

converts json object to an array of its contents

Params:

NameTypeAttributeDescription
json object

takes a json object

Return:

Array

arr returns an array of the given json object

public render(): html source

renders the display for the current page. displays courses

Return:

html

if there is a courselist return the list

public saveACourse(courseName: object) source

save a course

Params:

NameTypeAttributeDescription
courseName object

the name of the course

public searchUpdated(term: string) source

update search term after user imput

Params:

NameTypeAttributeDescription
term string

pass a search term