Closed francisrod01 closed 6 years ago
After the lunch, I investigated better the @NgModule
exports:
An export what you put is the exports property of the @NgModule decorator. It enables an Angular module to expose some of its components/directives/pipes to the other modules in the applications. Without it, the components/directives/pipes defined in a module could only be used in that module.
After reading better, I was able to solve the problem.
app.module.ts
components.module.ts
@NgModule
from ComponentsModule module.import {NgModule} from '@angular/core';
import {NativeScriptLocalizeModule} from 'nativescript-localize/angular';
import {NativeScriptModule} from 'nativescript-angular/nativescript.module';
// ... The imports from my own components class
const COMPONENTS: any = [
// .. my own components class
];
@NgModule({
imports: [
NativeScriptModule,
NativeScriptLocalizeModule
],
declarations: [
COMPONENTS
],
exports: [
COMPONENTS,
NativeScriptModule,
NativeScriptLocalizeModule
]
})
export class ComponentsModule { }
Regards!
This actually used to work just fine in my AppComponent. The app title (app.name) works just fine.
It's just the same error that #5 in this point, I don't know.
The point is I'm calling my own directive in
app.component.html
and in this component I'm trying to use this translation as well. I'll show you that:The
app.component.html
The
sale-new.component.ts
:The
sale-new.component.html
:Envs
The console error output following below:
In my
app.module.ts
I'm trying to define inexports
property as well, but don't work too.References
Role of imports / exports in Angular 2+ ngModule: https://stackoverflow.com/a/41927063/3332734