Hi, i’m new at Ionic and i need to set backButtonClick() method. But how can i use Navbar class? This way i’m getting this error
…
import { NavController, NavParams, Navbar } from ‘ionic-angular’;
…
@Component({
selector: ‘page-editor’,
templateUrl: ‘class-editor.html’
})
export class ClassName{
constructor(public navCtrl: NavController, public navParams: NavParams, public navbar: Navbar) {
}
Error:
Error: No provider for Navbar!
at NoProviderError.BaseError [as constructor] (http://localhost:8100/build/main.js:7445:34)
at NoProviderError.AbstractProviderError [as constructor] (http://localhost:8100/build/main.js:51992:16)
at new NoProviderError (http://localhost:8100/build/main.js:52023:16)
at ReflectiveInjector_.throwOrNull (http://localhost:8100/build/main.js:96744:19)
at ReflectiveInjector.getByKeyDefault (http://localhost:8100/build/main.js:96772:25)
at ReflectiveInjector.getByKey (http://localhost:8100/build/main.js:96735:25)
at ReflectiveInjector.get (http://localhost:8100/build/main.js:96544:21)
at AppModuleInjector.NgModuleInjector.get (http://localhost:8100/build/main.js:52694:52)
at CompiledTemplate.proxyViewClass.AppView.injectorGet (http://localhost:8100/build/main.js:97286:45)
at CompiledTemplate.proxyViewClass.DebugAppView.injectorGet (http://localhost:8100/build/main.js:97528:49)
Am i using it the right way?
Thanks,
David