angular-blaze-template icon indicating copy to clipboard operation
angular-blaze-template copied to clipboard

Does not work with meteor 1.3

Open Undeadlol1 opened this issue 9 years ago • 10 comments

Obviously with new npm style import-export system previous versions of meteor packages do not work properly. Basically i get this error:

WARNING: Tried to load angular more than once. and: Uncaught TypeError: _angular2.default.module(...).component

Obviously "angular-blaze-template" imports meteor's angular before i manually import angular from npm.

Am i doing something wrong or should i just wait for the package updates?

Undeadlol1 avatar Apr 05 '16 08:04 Undeadlol1

Not so sure what you tried to do... Why "angular2" is in the error? This package is for Angular 1... can you please provide more info?

dotansimha avatar Apr 09 '16 20:04 dotansimha

@dotansimha I were also surprised by " _angular2" message. Although this error dissapeared when i upgraded Meteor's Angular to version 1.5. My quess is "_angular2.default.module(...)" is angular's way to report errors while encountering something not familiar. Like ".component" method, because there were no components prior v1.5 if i recall correctly. Just to clarify: i did not installed anything Angular 2 related ever, so i think error had nothing todo with Angular 2. About what i tried to do: angular-blaze-template package used to allow me not to worry about how login/signup pages looked in my apps. Whenever i used Bootstrap or Materializecss i could just install "useraccounts:bootstrap" or "useraccounts:materialize", then drop

<blaze-template name="loginButtons"></blaze-template> <blaze-template name="atForm"></blaze-template>

and i had beautifull prestyled and preconfigured templates. I do appreciate your work on 'accounts-ui-angular' @dotansimha but the reason i use Meteor is because it allows me to use alot existing solutions and i don't want to style login ui in every meteor project.

Undeadlol1 avatar Apr 09 '16 22:04 Undeadlol1

@Undeadlol1 I think I understand the problem. angular-blaze-template is dependent on angular-with-blaze and angular-with-blaze is dependent on angular-meteor-data atmosphere package. So if you bring angular-meteor from npm, then you will get 2 Angular dependencies. It can be fixed like here I think - https://github.com/dotansimha/accounts-ui-angular/pull/7 I won't get to it today so I would love if you could try to fix it, test it and submit a pull request for that?

Urigo avatar Apr 10 '16 21:04 Urigo

@Urigo I tried to fix packages and make a pull request i really did. But i am weak and i bring shame on my family. The only input i can give after few experiments: even when multiple angular loads will be fixed, there still will be something which prevents angular-blaze-template to work. I have no idea what it is, and i hope i am wrong about it.

Undeadlol1 avatar Apr 10 '16 23:04 Undeadlol1

Any updates on this?

Undeadlol1 avatar Apr 25 '16 16:04 Undeadlol1

FYI in case you're wondering, I am not going to create a PR for the above because this is a single file https://github.com/trajano/meteor-boilerplate/blob/angular/imports/ui/components/blazeTemplate.directive.js that is only viable on the client side. It would be better to repackage as an npm module, but that basically redoes almost everything on this project.

This works with useraccounts:unstyled and their atForm template. You can see how it is used on the branch https://github.com/trajano/meteor-boilerplate/tree/angular

However, if @Urigo is interested, please feel free to repackage it and put it on npm, it won't feel right if I did it.

trajano avatar May 01 '16 01:05 trajano

After discussions with @sashko on https://forums.meteor.com/t/meteor-guide-methods/19662/23 I decided that I think it's okay that this is still an Atmosphere package, so I created a PR. Hopefully @Urigo can release it soon so I can take it out of https://github.com/trajano/meteor-boilerplate

trajano avatar May 15 '16 05:05 trajano

@Undeadlol1 you can use my fork using git submodules. Do the following to enable it.

git submodule init 
mkdir packages
cd packages
git clone https://github.com/trajano/angular-blaze-template.git
cd ..
meteor add Urigo:angular-blaze-template
meteor update

trajano avatar May 15 '16 06:05 trajano

This still doesn't work. I can confirm that the "tried to load angular more than once" warning appears consistently, and that I can't get my <blaze-template name="sAlert"></blaze-template> to work.

leosco avatar Sep 07 '16 00:09 leosco

I'm guessing the reason that's happening is because the urigo:angular-blaze-template atmosphere package depends on various angular atmosphere packages, when we've already included angular from npm. Therefore, the client loader is trying to load both the atmosphere angular and npm angular. Though, I don't know how tricky it would be to migrate this package away from atmosphere to npm, considering it has to translate blaze to angular templates.

leosco avatar Sep 07 '16 00:09 leosco