@varshil29 wrote:
i created a common function that check drawer is opened or not .so i created one class and constructor.
below is the code
@Injectable()
export class AllFunctions {constructor(private alertTag:AlertController,nav:NavController,private loading:LoadingController,menuCtrl:MenuController)
{
this.navController = nav;
this.menu = menuCtrl;}
close() {
if(this.menu.isOpen())
{
this.menu.close();
}
else
{
this.navController.pop();
}
}
}when i run my code i got error : No provider for NavController.
i also add class AllFunction in app.ts fileionicBootstrap(MyApp,[WebService,AllFunctions,
provideForms(),
disableDeprecatedForms()], {
platforms: {
android: {
tabsPlacement: 'top',
tabsHideOnSubPages: true,
tabsHighlight: true
}
}
});
Posts: 2
Participants: 2