在我的应用程序中,我喜欢为医生创建一个主人(CRUD).我有一个医生组件,用于创建,编辑和列出.用于查看它的单独组件.我想像URL一样
physician/create
physician/list
physician/edit/3
Run Code Online (Sandbox Code Playgroud)
所以我创建了带孩子的路线
const routes: Routes = [
{
path: 'physician',
children: [
{ path: 'list', component: PhysicianComponent },
{ path: 'create', component: PhysicianComponent },
{ path: 'update/:id', component: PhysicianComponent },
{ path: 'view/:id', component: PhysicianViewComponent }
]
}
Run Code Online (Sandbox Code Playgroud)
对于create,update和list,我想使用相同的组件,但使用组件类中的一些条件来使用不同的输出
我使用ng-table为admin和用户使用相同的控制器,相同的视图但是加载了不同URL的数据,但是从缓存中获取数据时它会从缓存中重新加载数据(我想在用户注销时清除)
调节器
myApp.controller('listArticle', ['$scope', '$filter', 'ngTableParams', 'nameService', '$rootScope', '$location', '$timeout', '$cookieStore', 'flashService', '$templateCache',
function ($scope, $filter, ngTableParams, nameService, $rootScope, $location, $timeout, $cookieStore, flashService, $templateCache)
{
//$templateCache.removeAll();
$scope.success = {};
$scope.article = {};
$scope.article.edit = '-';
$scope.article.approve = '-';
$scope.article.view = 'view';
$scope.showAlert = true;
flashService.displayAlertMessages();
$scope.tableParams = new ngTableParams(
{
page: 1, // show first page
count: 10, // count per page
sorting: {name: 'asc'}
},
{
total: 0, // length of data
getData: function ($defer, params)
{
nameService.getData($defer, params, …
Run Code Online (Sandbox Code Playgroud) 我已经尝试过yii2高级安装,它可以工作并且页面已经创建.但是为了验证安装,我使用了PHP YII服务命令.它会引发错误
文档根"/ var/www/html/highwaymotels/console/web"不存在.
但是,当我检查高级模板github时,它与我的文件夹相同.我做错了吗?否则这里的问题是什么?
@Component({
selector: 'app-hero-list-basic',
template: `
<ul>
<li *ngFor="let hero of heroes"
[@heroState]="hero.state"
(click)="hero.toggleState()">
{{hero.name}}
</li>
</ul>`,
Run Code Online (Sandbox Code Playgroud)
我尝试了角度动画,它工作正常,我不明白这个模板部分,为什么他们在视图中使用@ -symbol前面的触发器.
文件:这里