小编Nar*_*rsa的帖子

我应该以什么顺序在我的共享模块中导入模块

我创建了一个如下所示的共享模块。我在某处读到进口订单很重要,但我现在找不到那个链接。在某些地方它工作正常,但在其他地方我收到错误。我想知道这些模块需要的顺序以避免任何错误。

import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import 'hammerjs';

import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { HttpClientModule } from '@angular/common/http';
import { MaterialModule } from '@angular/material';
import { FlexLayoutModule } from '@angular/flex-layout';
import { CoreModule } from './core/core.module';

// NOTE: The import order matters.
const modules = [
  CommonModule,
  CoreModule,
  ReactiveFormsModule,
  FormsModule,
  HttpClientModule,
  MaterialModule,
  FlexLayoutModule,
];

@NgModule({
  imports: modules,
  exports: modules
})
export class DependenciesModule { }
Run Code Online (Sandbox Code Playgroud)

node-modules angular

5
推荐指数
1
解决办法
3068
查看次数

我是android Java的初学者.任何人都可以解释代码

编写此代码是为了按月对hashmap进行排序,但我无法完全理解.谁能解释一下呢.另外我想知道我是否正在for循环中正确访问hashmap.monthAnalysis是hashmap的名称,month是关键.对不起,我忘了提到我知道它将数据添加到表动态创建行.我的问题是前4行代码.

public void addData1(TableLayout tableLayout, HashMap<String, MonthAnalysis> monthAnalysis) {

    String[] sortedMonthList = (String[]) monthAnalysis.keySet().toArray();
    Arrays.sort(sortedMonthList);

    for (String month : sortedMonthList) {
        /* Create a TableRow dynamically */
        TableRow tr = new TableRow(this);
        tr.setLayoutParams(new TableLayout.LayoutParams(
                TableLayout.LayoutParams.MATCH_PARENT,
                TableLayout.LayoutParams.WRAP_CONTENT));
        addRowItem(tr, getMonth(month), 1.3f, Typeface.DEFAULT, Color.parseColor("#000000"), Gravity.LEFT);
        addRowItem(tr, Long.toString(monthAnalysis.get(month).credit), 0.9f, Typeface.DEFAULT, Color.parseColor("#000000"), Gravity.RIGHT);
        addRowItem(tr, Long.toString(monthAnalysis.get(month).debit), 1f, Typeface.DEFAULT, Color.parseColor("#000000"), Gravity.RIGHT);
        //addRowItem(tr, convertDate(Long.parseLong(transaction.date)), 1.5f, Typeface.DEFAULT, Color.parseColor("#000000"), Gravity.RIGHT);

        tableLayout.addView(tr, new TableRow.LayoutParams(
                LayoutParams.MATCH_PARENT,
                LayoutParams.WRAP_CONTENT));
    }
}
Run Code Online (Sandbox Code Playgroud)

java android hashmap

1
推荐指数
1
解决办法
85
查看次数

标签 统计

android ×1

angular ×1

hashmap ×1

java ×1

node-modules ×1