diff --git a/modules/schematics/src/entity/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.actions.ts b/modules/schematics/src/entity/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.actions.ts index 02e55dc74b..92235a854f 100644 --- a/modules/schematics/src/entity/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.actions.ts +++ b/modules/schematics/src/entity/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.actions.ts @@ -16,31 +16,31 @@ export enum <%= classify(name) %>ActionTypes { export class Load<%= classify(name) %>s implements Action { readonly type = <%= classify(name) %>ActionTypes.Load<%= classify(name) %>s; - constructor(public payload: { <%= lowercase(name) %>s: <%= classify(name) %>[] }) {} + constructor(public payload: { <%= camelize(name) %>s: <%= classify(name) %>[] }) {} } export class Add<%= classify(name) %> implements Action { readonly type = <%= classify(name) %>ActionTypes.Add<%= classify(name) %>; - constructor(public payload: { <%= lowercase(name) %>: <%= classify(name) %> }) {} + constructor(public payload: { <%= camelize(name) %>: <%= classify(name) %> }) {} } export class Add<%= classify(name) %>s implements Action { readonly type = <%= classify(name) %>ActionTypes.Add<%= classify(name) %>s; - constructor(public payload: { <%= lowercase(name) %>s: <%= classify(name) %>[] }) {} + constructor(public payload: { <%= camelize(name) %>s: <%= classify(name) %>[] }) {} } export class Update<%= classify(name) %> implements Action { readonly type = <%= classify(name) %>ActionTypes.Update<%= classify(name) %>; - constructor(public payload: { <%= lowercase(name) %>: Update<<%= classify(name) %>> }) {} + constructor(public payload: { <%= camelize(name) %>: Update<<%= classify(name) %>> }) {} } export class Update<%= classify(name) %>s implements Action { readonly type = <%= classify(name) %>ActionTypes.Update<%= classify(name) %>s; - constructor(public payload: { <%= lowercase(name) %>s: Update<<%= classify(name) %>>[] }) {} + constructor(public payload: { <%= camelize(name) %>s: Update<<%= classify(name) %>>[] }) {} } export class Delete<%= classify(name) %> implements Action { diff --git a/modules/schematics/src/entity/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.reducer.ts b/modules/schematics/src/entity/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.reducer.ts index cf2ad4e492..d386665321 100644 --- a/modules/schematics/src/entity/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.reducer.ts +++ b/modules/schematics/src/entity/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.reducer.ts @@ -18,19 +18,19 @@ export function reducer( ): State { switch (action.type) { case <%= classify(name) %>ActionTypes.Add<%= classify(name) %>: { - return adapter.addOne(action.payload.<%= lowercase(classify(name)) %>, state); + return adapter.addOne(action.payload.<%= camelize(name) %>, state); } case <%= classify(name) %>ActionTypes.Add<%= classify(name) %>s: { - return adapter.addMany(action.payload.<%= lowercase(classify(name)) %>s, state); + return adapter.addMany(action.payload.<%= camelize(name) %>s, state); } case <%= classify(name) %>ActionTypes.Update<%= classify(name) %>: { - return adapter.updateOne(action.payload.<%= lowercase(classify(name)) %>, state); + return adapter.updateOne(action.payload.<%= camelize(name) %>, state); } case <%= classify(name) %>ActionTypes.Update<%= classify(name) %>s: { - return adapter.updateMany(action.payload.<%= lowercase(classify(name)) %>s, state); + return adapter.updateMany(action.payload.<%= camelize(name) %>s, state); } case <%= classify(name) %>ActionTypes.Delete<%= classify(name) %>: { @@ -42,7 +42,7 @@ export function reducer( } case <%= classify(name) %>ActionTypes.Load<%= classify(name) %>s: { - return adapter.addAll(action.payload.<%= lowercase(classify(name)) %>s, state); + return adapter.addAll(action.payload.<%= camelize(name) %>s, state); } case <%= classify(name) %>ActionTypes.Clear<%= classify(name) %>s: { diff --git a/modules/schematics/src/entity/index.ts b/modules/schematics/src/entity/index.ts index 5eb8b3f93c..b1017526e3 100644 --- a/modules/schematics/src/entity/index.ts +++ b/modules/schematics/src/entity/index.ts @@ -46,8 +46,8 @@ export default function(options: EntityOptions): Rule { ]); return chain([ - addReducerToState({ ...options, flat: true }), - addReducerImportToNgModule({ ...options, flat: true }), + addReducerToState({ ...options }), + addReducerImportToNgModule({ ...options }), branchAndMerge(chain([mergeWith(templateSource)])), ])(host, context); };