Comments (12)
Ok, I think I see the problem.
You never said anything about installing as a nativescript plugin.
I installed as an npm package like the instruction says npm install nativescript-floatingactionbutton
tns install
installs other dependencies too, in this case;
"Installing MNFloatingActionButton (0.1.5)
”
I installed as nativescript plugin,
tns plugin add nativescript-floatingactionbutton
...and everything works fine.
Thanks for the plugin, Brad. :)
from nativescript-floatingactionbutton.
Yep. Almost any plugin that is plain NATIVESCRIPT works with Angular. Make sure you run a full build after adding plugins with native deps and if using angular you'll need to use registerElement()
like you mentioned.
from nativescript-floatingactionbutton.
thanks for the quick reply, Brad. I already did multiple full builds before reporting this. I'm not using angular. my project is just Typescript (that gets "compiled" to js). I don't know if I'm right, but I think a ".d.ts
" file which contains the module declaration might be needed in the plugin folder. This is obtainable for other plugins I already use.
from nativescript-floatingactionbutton.
Not a requirement. Those are definition/declarations for typescript. I use it all the time. Most of my plugin repos have them. This was the first plugin I did and was in plain js. So having the .d.ts file will help but that's not the issue for anything failing and some IDEs resolve modules better than others. At any rate. I'm fairly certain I have this working with the latest NativeScript version since typescript wouldn't be involved with this plugin at any point. Also if a plugin is in typescript it should really only ship the transpiled .js to npm since TS isnt being ran through anything.
Sorry for the long message. Have you added the xmlns to the page component in your UI?
from nativescript-floatingactionbutton.
message wasn't long, I read everything. :) ..yes, I added the xmlns to page like you described in usage.
Just to be sure, below is the xml for the page.
<Page loaded="pageLoaded"
xmlns="http://schemas.nativescript.org/tns.xsd"
xmlns:FAB="nativescript-floatingactionbutton">
<Page.actionBar>
<ActionBar title=" "/>
</Page.actionBar>
<StackLayout orientation="vertical">
<GridLayout>
<GridLayout scaleX="1" scaleY="1" class="background"></GridLayout>
<GridLayout scaleX="1" scaleY="1" class="background-overlay"></GridLayout>
<GridLayout class="container" rows="70,auto,auto,*,20">
<StackLayout row="1">
<TextField text="{{ verifyInput }}" id="verifyTextField" hint="xxxxxxx" autocorrect="false" autocapitalizationType="allCharacters" returnPress="verify" returnKeyType="go" />
<Button text="Verify" tap="verify" class="btn-primary btn-verify" />
</StackLayout>
<StackLayout row="2" verticalAlignment="bottom">
<Button text="+" tap="{{ gotoRegister }}" class="register-shortcut" horizontalAlignment="right" />
</StackLayout>
<StackLayout row="3" verticalAlignment="bottom">
<FAB:fab tap="{{ gotoRegister }}"
row="1"
icon="res://my_icon"
rippleColor="#f1f1f1"
class="fab-button" />
</StackLayout>
</GridLayout>
<ActivityIndicator busy="{{ isLoading }}" />
</GridLayout>
</StackLayout>
</Page>
In the code, the Button
just above your FAB
, is what I currently use as my FAB. But I couldn't get the border radius to be perfect, so I need yours to work and save me. :)
I have fully built again, but the problem is still there.
from nativescript-floatingactionbutton.
from nativescript-floatingactionbutton.
ok. I built the new app like you suggested and used your XML. But at startup, the app crashes with the same error (JS ERROR Error: Building UI from XML. @file:///app/main-page.xml:12:13 ...
) as the one I posted above.
from nativescript-floatingactionbutton.
I just cloned the repo and ran the demo app using the latest NS versions of everything. Can you show me the actual commands you run, in order from starting a new app and trying this plugin? Then we can compare and see where something might be wrong.
from nativescript-floatingactionbutton.
ok.
tns create my-app-name --template typescript
I cd into the app project folder and
tns install typescript
npm install nativescript-floatingactionbutton
paste your page code, change your loaded="pageLoaded"
to their loaded="navigatingTo"
, as navigatingTo
is the exported function in the template's "main-page.ts".
then
tns run ios
from nativescript-floatingactionbutton.
from nativescript-floatingactionbutton.
from nativescript-floatingactionbutton.
Alright Brad, :) PR submitted.
from nativescript-floatingactionbutton.
Related Issues (20)
- Can I remove padding around icon? HOT 1
- Calling js method onCreateView failed HOT 2
- Error when adding the plugin HOT 1
- JS: topmost() is deprecated. Use Frame.topmost() instead. HOT 2
- How to use svg images HOT 2
- Fab is not showing when scroll completes HOT 1
- text is not working. HOT 6
- loadFromFontIconCode() is deprecated HOT 4
- Adapt icon to screen HOT 10
- Styles not applied on app build for production HOT 2
- FAB 2.0.1: font icons have different sizes on different screens HOT 1
- Crash in flexbox-layout.android.js - Right-hand side of 'instanceof' is not an object HOT 5
- NativeScript 7 update HOT 1
- Could not load view for: Fab.ReferenceError: NativeClass is not defined when used with {N} 7 with angular HOT 12
- FAB.TypeError: core_1.Property is not a constructor HOT 5
- Changing color to text does not work HOT 6
- Display the action items when Fab Button is clicked - Nativescript7 Angular10 HOT 3
- @nativescript/core still imported for lower version than NS7
- icon appearing bigger and cannot be resized HOT 2
- App is crashing on NS Angular
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nativescript-floatingactionbutton.