php - Angular 6 的代码点火器
问题描述
我想在使用 angular 6 的应用程序中使用 Code Igniter 的控制器和模型。
我的计划是:
- 前端使用 Angular 6
- 使用 CI 的控制器将数据发送到模型,然后模型将数据发送到数据库。
- 将应用程序的文件夹(代码点火器文件夹)除了我的角度应用程序的资产中的视图。
- 当我想做数据库事务时使用那个控制器。
我的问题是:
- 这行得通吗?
- 有缺点吗?
在发布此 OP 期间仍在开发我的应用程序。
auth.service
- 提交表单时调用
getUserDetails(username,password){
//post details to API server return info if correct
return this.http.post<myData>('/api/auth.php',{
username,
password
})
}
这是我将数据传递到控制器和控制器中的方式
我应该:
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');
}
}
我应该如何修复return this.http.post<myData>('/api/auth.php',{
才能调用函数登录?
解决方案
推荐阅读
- python - 如何使用变量将数据框传递给函数?
- transactions - 在 MarkLogic 中创建远程事务和附加语句
- html - 对于使用的图标字体,Chrome 未使用预加载警告
- apache-flex - 更新数据提供者的数据后保持排序
- push-notification - 收到远程通知时如何将导航推送到新的小部件?
- javascript - Recharts.js ResponsiveContainer 显示类似填充的空白
- salesforce - 我们是否需要编写一个可批处理的课程来安排课程
- powershell - 如何根据 Powershell 中的项目计数过滤子目录
- bootstrap-4 - 如何修复这种复杂的布局?
- postgresql - 解释分析扫描的实际行与表中的总行之间的差异