Coder Social home page Coder Social logo

Comments (6)

Adam95 avatar Adam95 commented on July 20, 2024 2

Had the same problem. Then I placed it in my top-level app component above the class definition and it works fine now.

import {registerElement} from 'nativescript-angular/element-registry';

registerElement('Fab', () => require('nativescript-floatingactionbutton').Fab);

@Component({
  selector: "ns-app",
  templateUrl: "app.template.html"
})
export class AppComponent implements OnInit {
...
}

from nativescript-floatingactionbutton.

bradmartin avatar bradmartin commented on July 20, 2024

Thanks @Adam95 for the info.

from nativescript-floatingactionbutton.

jafsparrow avatar jafsparrow commented on July 20, 2024

Hi.. I am getting the same error.
I tried adding those two line in AppComponent.ts.. same error.
pretty much tried with other components too.!!
any other solution..

import {registerElement} from 'nativescript-angular/element-registry';

registerElement('Fab', () => require('nativescript-floatingactionbutton').Fab);

@component({
selector: "ns-app",
templateUrl: "app.component.html",
})

from nativescript-floatingactionbutton.

bradmartin avatar bradmartin commented on July 20, 2024

I do this in app.component

import { Fab } from "nativescript-floatingactionbutton";
import { registerElement } from "nativescript-angular/element-registry";
registerElement("Fab", () => Fab);

and have no issues, hope that helps.

from nativescript-floatingactionbutton.

jafsparrow avatar jafsparrow commented on July 20, 2024

Tried this .. same error.
If I don't add these two line, I can see floating action. but a stretched version of it.
image

I will try to add FAB in a brand new sample project and try..

from nativescript-floatingactionbutton.

bradmartin avatar bradmartin commented on July 20, 2024

If it's stretched then you likely don't have a width set on it for the styler to apply. You only have to call registerElement once in your app and I do it in app.component in all of my apps and have no issue. So I'd check to make sure you don't have it called twice.

from nativescript-floatingactionbutton.

Related Issues (20)

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.