我正在尝试在我的 angular 应用程序中实现一个 Material 表。分页和过滤器工作正常,但我无法对我的表格进行排序。我对 MatSort 的引用未定义。
我确实在 AppModule 中导入了它:
import {MatTableModule} from '@angular/material/table';
import {MatTooltipModule} from '@angular/material/tooltip';
import {MatButtonModule, MatCheckboxModule,MatPaginatorModule,MatInputModule} from '@angular/material';
import {MatSortModule} from '@angular/material/sort';
...
@NgModule({
declarations: [...],
imports: [
MatSortModule,
MatTableModule,
MatPaginatorModule,
MatInputModule,
...
]
})
Run Code Online (Sandbox Code Playgroud)
这是我的 component.ts:
import { Component, OnInit , ViewChild, AfterViewInit} from '@angular/core';
...
import {MatTableDataSource,MatSort,MatPaginator} from '@angular/material';
...
export class MyClass inplements OnInit, AfterViewInit{
@ViewChild(MatSort) sort:MatSort;
@ViewChild(MatPaginator) paginator:MatPaginator;
...
ngAfterViewInit(){
this.dataSource = new MatTableDataSource(this.fake_data);
this.dataSource.paginator = this.paginator
this.dataSource.sort = this.sort
} …Run Code Online (Sandbox Code Playgroud) 我正在使用 Ionic Framework 和 Firebase 开发一个应用程序。我进行了自定义登录以获取 Firebase 中的数据,但每次重新启动应用程序时,我都需要再次登录。我怎样才能坚持登录?用户应该第一次登录,不需要再次登录。
这是我的服务:
(function() {
'use strict';
angular
.module('mytodo.login')
.factory('LoginService', LoginService);
LoginService.$inject = ['$state', '$ionicLoading', '$firebaseAuth', '$firebaseObject','$rootScope', '$timeout', 'fb', '$q'];
function LoginService($state, $ionicLoading, $firebaseAuth, $firebaseObject, $rootScope, $timeout, fb, $q){
var service = {
CustomLogin: CustomLogin,
GetCurrentUser: GetCurrentUser,
RegisterUser: RegisterUser,
};
return service;
function CustomLogin(email, password) {
if(email ==null | password == null){
console.log('Preencha todos os campos!');
return;
}
$ionicLoading.show({
showBackdrop: false,
template: '<p>Carregando...</p><ion-spinner icon="android" style="stroke: #1d9c9e;fill:#1d9c9e;"></ion-spinner>'
});
$firebaseAuth().$signInWithEmailAndPassword(email, password).then(function(authData) {
$rootScope.currentUser = GetCurrentUser(authData.uid);
$timeout(function() …Run Code Online (Sandbox Code Playgroud)抱歉我的问题,我知道这是一个愚蠢的问题。我想开始游戏开发,我应该从哪里开始?我应该从 libGDX、Love2D 还是 Monogame 开始。我知道如何使用这种语言(JAVA、LUA 和 C#)进行编程。我只是想从那些比我更有经验的人那里获得意见。请帮助我。谢谢