showdownjs / ng-showdown

Angular integration for Showdown
BSD 3-Clause "New" or "Revised" License
105 stars 33 forks source link

unable to add ng-showdown in Electron app #29

Closed bansalvks closed 8 years ago

bansalvks commented 8 years ago

image

I am trying to build a cross-platform app using electron js. In the app I am not able to integrate ng-showdown

tivie commented 8 years ago

ng-showdown requires angular to be previously loaded.

bansalvks commented 8 years ago

@tivie it is working fine on browser but in an electron it is not working

tivie commented 8 years ago

I believe this has something to do with electron itself. I can't help you much there, since I'm not familiar with that framework. Maybe ask in their forums?

If there's something we need to change in our library to make it compatible, we will hapilly try to implement it.

bansalvks commented 8 years ago

Many thanks for such a humble reply. I will let you know if I get information regarding to the error. On Jun 22, 2016 8:54 PM, "Estevão Soares dos Santos" < notifications@github.com> wrote:

I believe this has something to do with electron itself. I can't help you much there, since I'm not familiar with that framework. Maybe ask in their forums?

If there's something we need to change in our library to make it compatible, we will hapilly try to implement it.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/showdownjs/ng-showdown/issues/29#issuecomment-227779553, or mute the thread https://github.com/notifications/unsubscribe/AIK06dXk_uq5MweekyVuEQttDtVAdsp6ks5qOVOMgaJpZM4I6thp .

SyntaxRules commented 8 years ago

Closing, let us know what you find out!

HadrienPierart commented 7 years ago

I have encountered the same issue with this library and with angular-moment actually. The issue comes from the way angular and the dependencies are required. Somehow, something is wrong with the ifs deciding wether require is supported and the module tries to start with the wrong require way. Angular Moment has fixed this issue this way :


 +  var isElectron = window && window.process && window.process.type;
    if (typeof define === 'function' && define.amd) {
        define(['angular', 'moment'], angularMoment);
 -  } else if (typeof module !== 'undefined' && module && module.exports && (typeof require === 'function')) {
 +  } else if (typeof module !== 'undefined' && module && module.exports && (typeof require === 'function') && !isElectron) {
        module.exports = angularMoment(require('angular'), require('moment'));
    } else {
        angularMoment(angular, (typeof global !== 'undefined' ? global : window).moment);

https://github.com/urish/angular-moment/commit/dccdbbcea6421def5c000c6c88f53affc103d5ad