I want to use Code Igniter's Controller and Model in my application that uses angular 6.
My plan is:
My questions is:
Still developing my application during posting of this OP.
auth.service
- this is called when form is submitted
getUserDetails(username,password){
//post details to API server return info if correct
return this.http.post<myData>('/api/auth.php',{
username,
password
})
}
this is my way to pass my data into my controller and in my controller
I should have:
public function login()
{
$this->form_validation->set_rules('username','Username','trim');
$this->form_validation->set_rules('password','Password','trim|callback_authentication');
if($this->form_validation->run() == FALSE)
{
$this->index();
}
else
{
redirect('Home');
}
}
How should I fix return this.http.post<myData>('/api/auth.php',{
so that I can call the function login?