Problem with Example code


#1

Hi
I try http://ionicframework.com/docs/v2/getting-started/tutorial/adding-pages/ and found

import {Page} from 'ionic/ionic';

@Page({
  templateUrl: 'build/pages/hello-ionic/hello-ionic.html'
})
export class HelloIonicPage {
  constructor() {
  }

}

this code through an error

Error: Cannot find module “./pages/hello-ionic/hello-ionic”…tion webpackMissingModule() { var e = new Error("Cannot find module "./pages/he…

but when use
import {Page} from 'ionic-framework/ionic';
No error ,and working fine …

please let me know what’s wrong ?


#2

Can we see the file structure of your code. It might help us find the error.


#3

please let me know if you need any other information .


#4

As far as I know, those examples are created while still in alpha version thus some code should be applied differently

Currently I use ionic@beta version, and indeed they use ionic-framework folder instead of just ionic.
Well, since ionic 2 is not stable yet, anything could change :grinning:
Hoping to see release date for ionic2 as I found this framework is amazing and much more easier to understand (than Ionic 1, I skip Ionic 1 and go straight to Ionic 2).


#5

Thanks for comprehensive reply .mow an question come in my mind ,if

and all example not update accordingly .where we can found actual code example .


#6

We just need to update the tutorial. If you feel like sending a PR to update, it would really speed up the process.


#7

@kuntal for best practice, I suggest to add template upon starting new app (since most template are working!) as starting point. From there you can go to add page (e.g: from tabs example) by copying page folder and make adjustment on app.js