Urigo / meteor-ionic

Ionic framework packaged for Meteor.
216 stars 32 forks source link

Seeing <!DOCTYPE html> errors #40

Closed ambujpunn closed 9 years ago

ambujpunn commented 9 years ago

I created a meteor project and did meteor add urigo:ionic and added these lines into my html page:

<link href="lib/ionic/css/ionic.css" rel="stylesheet">
<script src="lib/ionic/js/ionic.js"></script>
<script src="lib/ionic/js/ionic-angular.js"></script>

I keep getting an error in the console reporting that the <!DOCTYPE html> shouldn't be there. Is there a way to have these require ionic js files to not have this as it isn't required in meteor.

elmor34 commented 9 years ago

This works even with the lates version 1.1. Only urigo:ionic and urigo:angular need to be added with meteor add. No need to place link and script to index.

<link href="lib/ionic/css/ionic.css" rel="stylesheet">
<script src="lib/ionic/js/ionic.js"></script>
<script src="lib/ionic/js/ionic-angular.js"></script>

Change packages to :

Packages to :

meteor-platform
insecure
urigo:ionic
urigo:angular

and app bootstrap to :

    Meteor.startup(function ()
    {
      angular.bootstrap(document, ['starter']);
    });

angular.module('starter', ['angular-meteor','ionic', 'starter.controllers'])

.run(['$ionicPlatform',function($ionicPlatform) {
  $ionicPlatform.ready(function() {
    // Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
    // for form inputs)
    if(window.cordova && window.cordova.plugins.Keyboard) {
      cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
    }
    if(window.StatusBar) {
      // org.apache.cordova.statusbar required
      StatusBar.styleDefault();
    }
  });
}])
Urigo commented 9 years ago

Thanks @elmor34

ambujpunn commented 9 years ago

Hi @elmor34, I'm quite new to meteor and ionic and after putting all those changes I seem to be getting more errors, here's a gist: https://gist.github.com/ambujpunn/a6237ecdf86a2f85e8f8 I'm getting errors that state that the angular variable hasn't been initialized. It makes sense to me too because when you state angular.bootstrap, where does the angular come from?

This is the error I'm seeing:

W20150401-22:50:10.525(-7)? (STDERR) ReferenceError: angular is not defined
W20150401-22:50:10.525(-7)? (STDERR)     at app/meteorionic.js:29:1
W20150401-22:50:10.525(-7)? (STDERR)     at app/meteorionic.js:44:3
W20150401-22:50:10.526(-7)? (STDERR)     at /Users/ambujpunn/dev/meteor/meteorionic/.meteor/local/build/programs/server/boot.js:222:10
ambujpunn commented 9 years ago

@elmor34 @Urigo any updates?

ambujpunn commented 9 years ago

@elmor34 @Urigo , how do get meteor to recognize the angular variable? I feel like this is a trivial issue and I've attached my gist links to this issue as well. What could be the problem?

ambujpunn commented 9 years ago

I was able to figure it out. I integrated Ionic&Angular with Meteor successfully. If people have more questions on such issues, please take a look at my simple git repo: https://github.com/ambujpunn/meteorionic

Thanks @Urigo and @elmor34 for your patience and great amount of help!

Urigo commented 9 years ago

Cool! How did you deploy with CrossWalk?

ambujpunn commented 9 years ago

I'm still in progress of doing that. I updated my readme to show that, I'll keep you all in the loop once I get somewhere with that! :beers: