Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Again - Cannot set property 'value' of null #69

Closed
eglaw opened this issue Nov 23, 2016 · 7 comments
Closed

Again - Cannot set property 'value' of null #69

eglaw opened this issue Nov 23, 2016 · 7 comments

Comments

@eglaw
Copy link

eglaw commented Nov 23, 2016

installed everything as told.
My application works in all, sometimes even the SweetAlert works too.

But in one controller i can't get it to work!

$scope.test = function() {
SweetAlert.swal("Hello world");
}

template: Say hi

gives me an immediate TypeError: Cannot set property 'value' of null.

What's the problem? All arguments are injected correctly into my controller, the order is correct- no thing is missing. The rest of the code works perfect.

@DannyMcwaves
Copy link

hi @egorlaw,
Can you give me a jsFiddle of the code that is causing the problem or detailed rep of the full controller might help.

@eglaw
Copy link
Author

eglaw commented Nov 25, 2016

hi @DannyMcwaves ,
I've managed to found the problem.

I loved the animated in css icons that sweetalert uses (like the Success one - with the check on the green circle) and i used it in side my template for the step of the form that is a "thank-you" kinda-like page. During the http async request (before going to that step) i pop out $uibModal.open and make a loading. After resolving the modal with $scope.$close i try to make the user awar of the successful transaction with an SweetAlert.swal, but the error would make the thing impossible.

What i've found is that NEVER USE any of the markup / classes that are sweet-alert native. Because it'll try to instantiate them as already existing on page and try to clean the mess. But there's no sweetalert on page so far - so it lauches the error.

My template had this element:

<div class="sweet-alert animate">
    <div class="sa-icon sa-success animate" style="display: block;">
        <span class="sa-line sa-tip animateSuccessTip"></span>
        <span class="sa-line sa-long animateSuccessLong"></span>
        <div class="sa-placeholder"></div>
        <div class="sa-fix"></div>
    </div>
</div>

This breaks the sweetalert behaviour. Probably any other part of the swal constructs as overlays and body or else - will break the stuff too.

Don't try this at home folks ;)

@eglaw eglaw closed this as completed Nov 25, 2016
@DannyMcwaves
Copy link

Hi @egorlaw
Great. I am very glad that you have fixed that.
I saw your profile and I realized you can code python. I was wondering if you have enough time,
so we can collaborate on this python project I am trying to work on.
If you have enough time, just let me know.

@eglaw
Copy link
Author

eglaw commented Nov 28, 2016 via email

@DannyMcwaves
Copy link

cool. Are you using angular 2, @egorlaw ??

@eglaw
Copy link
Author

eglaw commented Nov 28, 2016 via email

@DannyMcwaves
Copy link

Nice. If you have any projects on angular or angular 2 that you think you might need collaboration on, just let me know. If you have an understanding with angular 1, can you check this project I created, ngSocial in in my repo, and see if you can find any issues. Also I am following you, can you follow back?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants