ionic 2 Alert not working on webpage
<p>I would like to raise an alert on Ionic2 when the device does not have a Camera.</p>

<p>When i launch :  ionic serve</p>

<p>then i try to display the message as follow :</p>

<pre><code> let alert = Alert.create({
                title: 'Camera not found',
                subTitle: 'It seems your camera is not working on your device',
                buttons: ['Ok']
            });
            this.nav.present(alert);
</code></pre>

<p>i have a javascript error</p>

<pre><code>Uncaught EXCEPTION: Error during evaluation of "click"
ORIGINAL EXCEPTION: TypeError: rootNav.getActive is not a function
ORIGINAL STACKTRACE:
TypeError: rootNav.getActive is not a function
    at Tab.NavController.present (http://localhost:8100/build/js/app.bundle.js:46996:36)
    at SmartScan.takePicture (http://localhost:8100/build/js/app.bundle.js:60864:23)
    at AbstractChangeDetector.ChangeDetector_SmartScan_0.handleEventInternal (eval at &lt;anonymous&gt; (http://localhost:8100/build/js/app.bundle.js:14578:17), &lt;anonymous&gt;:185:36)
    at AbstractChangeDetector.handleEvent (http://localhost:8100/build/js/app.bundle.js:13892:25)
    at AppView.dispatchEvent (http://localhost:8100/build/js/app.bundle.js:18772:46)
    at AppView.dispatchRenderEvent (http://localhost:8100/build/js/app.bundle.js:18766:22)
    at DefaultRenderView.dispatchRenderEvent (http://localhost:8100/build/js/app.bundle.js:33592:39)
    at eventDispatcher (http://localhost:8100/build/js/app.bundle.js:33258:22)
    at http://localhost:8100/build/js/app.bundle.js:33329:40
</code></pre>

<p><a href="https://i.stack.imgur.com/wYVYD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wYVYD.png" alt="enter image description here"></a></p>