Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70857

Error no provider for navController

$
0
0

@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 file

ionicBootstrap(MyApp,[WebService,AllFunctions,
provideForms(),
disableDeprecatedForms()], {
platforms: {
android: {
tabsPlacement: 'top',
tabsHideOnSubPages: true,
tabsHighlight: true
}
}
});

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 70857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>