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

Nativescript-Angular -- "FAB" becomes empty ProxyViewContainer #75

Closed
kalexmills opened this issue May 29, 2018 · 1 comment
Closed

Comments

@kalexmills
Copy link

kalexmills commented May 29, 2018

The FAB button is just becoming an empty ProxyViewContainer in NativeScript for unknown reasons.

Here is the way I am using it with NativeScript Angular.

<StackLayout>
  <ListView [items]="...">
    <!-- unimportant stuff here -->
  </ListView>
  <Fab (tap)="addFlavorLog"
        icon="res://ic_add_white" rippleColor="#f1f1f1" class="fab-button">
  </Fab>
</StackLayout>

I am loading the FAB once at the bottom of vendor.ts (I guessed that this might be good place to put it... but the docs are unclear).

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

Here is the output:

<ProxyViewContainer nativeViewProtected="undefined" icon="res://ic_add_white" ...></ProxyViewContainer>
@kalexmills
Copy link
Author

Got this to finally work after much digging around online.

@bradmartin: One suggestion for documentation in the README for this repo. For Nativescript + Angular users, please specify that the registerElement call belongs in the constructor of app.component.ts (only way I could get it to work). Seems like all the questions I found on Stackoverflow were related to this issue...

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

1 participant