Giter Club home page Giter Club logo

nativescript-globalevents's Introduction

NativeScript-Global-Events

This version is completely unsupported and untested on NativeScript 6. Please upgrade your plugin to the tested, supported and maintained version.

Documentation for this plugin is located at here

nativescript-globalevents's People

Contributors

bradmartin avatar nathanaela avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

nativescript-globalevents's Issues

"_First" events are not being added to Page object

Bug Report

Tell us about the problem

The on() and addEventListener() methods exist on the NS Page object, so the Page object is never extended and the special First events are never defined.

Which NativeScript version and platform does your issue occur on?

Using "tns-core-modules" version 5.4.1 with Angular and TypeScript.

Any steps to duplicate?

Simply run the app and observe that the First events (i.e. Page.navigatingToFirst) are not defined.

Help required implementing your nativescript-globalevents for Label

Hi, Thank you for wanting to report an issue on this project!

If this is a bug report or feature request, awesome!

If you are asking for support, the issue will be closed with a gentle reminder that this is an open source repo with the full source.

Since this is a open source plugin, any and all support needs to be paid, you can contact me at [email protected].

Tell us about the problem

Please give me a good overview of the problem.

Visit the following URL,
https://discourse.nativescript.org/t/nativescript-hacks-here-are-mine-share-yours/3516

  1. The first hack is to center align text in a Label horizontally and vertically
  2. It works perfectly fine when written on an individual page
  3. I wanted to write it globally once so that by default for every Label in a page the text is center aligned vertically and horizontally
  4. I tried to use your plugin to achieve the same, it gives me error as "label.on is not a function".

I am new to NativeScript, so is it possible for you to help me solve this issue? I have also sent you an email on your ID mentioned above.

Which NativeScript version and platform does your issue occur on?

Please do a tns info on your project and paste the results here.

nativescript - 3.4.3 - Up to date
tns-core-modules - 3.4.1 - Up to date
tns-android - 3.4.2 - Up to date
tns-ios - 3.4.1 - Not installed

Any steps to duplicate?

Please list any steps or source code to duplicate the issue.

I added the following code in app.js,
require('nativescript-globalevents');

const label = require('ui/label').Label();
label.on('loadedEvent', function(event) {
if (event.object.android) {
event.object.android.setGravity(17);
}
});

bug: v1.2.0 breaks nativescript-angular

Hi,
Thanks for this plugin.

Tell us about the problem

Unfortunately the latest version (v1.2.0) breaks with nativescript-angular.

Just loading the plugin breaks the application with this error:

JS: ERROR Error: Uncaught (in promise): Error: No provider for NewPage!
JS: Error: No provider for NewPage!
JS:     at injectionError (file:///data/data/org.nativescript.globalevents120/files/app/tns_modules/@angular/core/bundles/core.umd.js:1201:90) [angular]
JS:     at noProviderError (file:///data/data/org.nativescript.globalevents120/files/app/tns_modules/@angular/core/bundles/core.umd.js:1239:12) [angular]
JS:     at ReflectiveInjector_._throwOrNull (file:///data/data/org.nativescript.globalevents120/files/app/tns_modules/@angular/core/bundles/core.umd.js:2681:19) [angular]
JS:     at ReflectiveInjector_._getByKeyDefault (file:///data/data/org.nativescript.globalevents120/files/app/tns_modules/@angular/core/bundles/core.umd.js:2720:25) [angular]
JS:     at ReflectiveInjector_._getByKey (file:///data/data/org.nativescript.globalevents120/files/app/tns_modules/@angular/core/bundles/core.umd.js:2652:25) [angular]
JS:     at ReflectiveInjector_.get (file:///data/data/org.nativescript.globalevents120/files/app/tns_modules/@angular/core/bundles/core.umd.js:2521:21) [angular]
JS:     at resolveNgModuleDep (file:///data/data/org.nativescript.globalevents120/files/app/tns_modules/@angular/core/bundles/core.umd.js:9524:25) [angular]
JS:     at NgModuleRef_.get (file:///data/data/org.nativescript.globalevents120/files/app/tns_modules/@angular/core/bundles/core.umd.js:10594:16) [angular]
JS:     at resolveDep (file:///data/data/org.nativescript.globalevents120/files/app/tns_modules/@angular/core/bundles/core.umd.js:11082:45) [angular]
JS:     at createClass (file:///data/data/org.nativescript.globalevents120/files/app/tns_modules/@angular/core/bundles/core.umd.js:10946:85) [angular]
JS:     at createDirectiveInstance (file:///data/data/org.nativescript.globalevents120/files/app/tns_modules/@angular/core/bundles/core.umd.js:10783:37) [angular]
JS:     at createViewNodes (file:///data/data/org.nativescript.globalevents120/files/app/tns_modules/@angular/core/bundles/core.umd.js:12224:53) [angular]
JS:     at callViewAction (file:///data/data/org.nativescript.globalevents120/files/app/tns_modules/@angular/core/bundles/core.umd.js:12654:13) [angular]
JS:     at execComponentViewsAction (file:///data/data/org.nativescript.globalevents120/files/app/tns_modules/@angular/core/bundles/core.umd.js:12563:13) [angular]

Which NativeScript version and platform does your issue occur on?

All NativeScript components versions information
┌──────────────────┬─────────────────┬────────────────┬───────────────┐
│ Component        │ Current version │ Latest version │ Information   │
│ nativescript     │ 3.2.1           │ 3.2.1          │ Up to date    │
│ tns-core-modules │ 3.2.0           │ 3.2.0          │ Up to date    │
│ tns-android      │ 3.2.0           │ 3.2.0          │ Up to date    │
│ tns-ios          │                 │ 3.2.0          │ Not installed │
└──────────────────┴─────────────────┴────────────────┴───────────────┘

Overriding the Page-class with the NewPage-class breaks angular's Dependency Injection.

Any steps to duplicate?

Please list any steps or source code to duplicate the issue.

  1. Start a new angular project with: tns create <project> --ng
  2. Add import 'nativescript-globalevents to app/app.module.ts
  3. Start with tns run android or tns run ios

Demo project here:

https://github.com/m-abs/ns-debugging/tree/master/globalevents-1.2.0

Console logs for removal in the source code

A client of nativescript-globalevents notice d that there are some console.log left in the source code

By the way, I'm getting this: CONSOLE LOG file:///app/tns_modules/nativescript-globalevents/globalevents.js:98:16: Handler onNavigatingTo navigatingTo - I think someone left this diagnostic in the latest release code.

Unable to bind to shownModallyFirst event

Hi @NathanaelA!

As of late the CSS classes from nativescript-platform-css are not added anymore in modals. If you remember, earlier this year I had submitted this PR, which fixed a similar problem for that plugin but it has stopped working since. It seems that this time the issue is with this plugin however, where the shownModallyFirst event is not firing (at least not in an Angular project).

As I recall there were some changes in NS with navigation in modals, and I suspect it may have to do with needing to attach to shownModally at the frame instead of the page as described here:

Currently, you would need to attach to the 'shownModally' event on the frame as the frame is the view (1st parameter) passed in showModal method

From your experience, does this sound plausible? Do you know what might be the culprit here and/or how to fix this?

Thanks!

Which NativeScript version and platform does your issue occur on?

$ tns info
✔ Getting NativeScript components versions information...
✔ Component nativescript has 5.1.0 version and is up to date.
✔ Component tns-core-modules has 5.1.0 version and is up to date.
✔ Component tns-android has 5.1.0 version and is up to date.
✔ Component tns-ios has 5.1.0 version and is up to date.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.