Angular2 integration with Nativescript footbar

I'm a newcomer to Nativescript UI and I'm looking for guidance on how to add a footer in Nativescript with angular2.

Currently, I am working on designing a page with tabs where I need to display a list view and a footer on one of the tabs. The list view is functioning correctly, as shown in the image below. However, I am struggling with designing the footer and fab button as I lack experience in making these changes.

Here is the code snippet:

<TabView [selectedIndex]="tabindex" selectedColor="#FF0000">
<StackLayout *tabItem="{title: 'Appertiser'}" >
    <Label text="Hello, I am Appertiser" marginTop="20" fontSize="20" horizontalAlignment="center" textAlignment="center"></Label>
</StackLayout>
<StackLayout *tabItem="{title: 'Noodles'}" >
    <ListView [items]="products">
        <template let-item="item">
            <GridLayout  rows="auto" columns="auto,*" class="list-wrapper">
                <Image  row="0" col="0" [src]="item.productImage" horizontalAlignment="left"></Image>
                <StackLayout row="0" col="1" orientation="vertical" horizontalAlignment="left" class="productDetail">
                    <Label [text]='item.productName' horizontalAlignment="left" class="productHeading"></Label>
                    <Label [text]='item.productShortDescription'  horizontalAlignment="left" class="productDescription"></Label>
                    <Label [text]='item.productTags'  horizontalAlignment="left" class="productTags"></Label>
                </StackLayout>
                <Image row="0" col="2" [src]="item.iconImage" width="20px" height="20px" horizontalAlignment="right"  verticalAlignment="top" marginRight="10"></Image>
                <GridLayout row="0" col="3" orientation="vertical" verticalAlignment="bottom">
                    <Label [text]='item.productPrice' class="productPrice" textColor="red" horizontalAlignment="right" class="productPrice"></Label>
                </GridLayout>
            </GridLayout>
        </template>

    </ListView>

    <FAB (tap)="toggleNav('Home')" rippleColor="#f1f1f1" class="fab-button"></FAB>


</StackLayout>
<StackLayout *tabItem="{title: 'Seafood'}">
    <Label text="Hello, I am Seafood" marginTop="20" fontSize="20"  textAlignment="left"></Label>

    <GridLayout row="1" column="0" rows="auto" columns="50,*,50" verticalAlignment="bottom" backgroundColor="lightgray" cssClass="footer">
        <Label text="My cat loves the camera" textWrap="true" col="1" colSpan="2" minHeight="50" fontSize="20" margin="3"></Label>
        <Label text="John Smith" col="1" row="1" fontSize="14" horizontalAlignment="left" verticalAlignment="bottom" margin="3"></Label>
        <Label text="comments: 26" col="2" row="1" color="#10C2B0" fontSize="14" verticalAlignment="bottom" margin="3"></Label>
    </GridLayout>
    <GridLayout cssClass="footer" row="1" column="0" rows="auto" columns="50,*,50">
        <Image src="{{flag}}" cssClass="flagimage" col="0" row="0"></Image>
        <Label text="{{lang}}" tap="{{goDefault}}" col="1" row="0" textAlignment="left"></Label>
        <Image src="~/res/icons/white/ellipsis_white.png" cssClass="iconwhitesmall" tap="{{goOther}}" row="0" col="2"></Image>
    </GridLayout>

</StackLayout>

Answer №1

If you're looking to become familiar with NativeScript + Angular-2, I suggest checking out this example app where various basic scenarios are demonstrated.

Regarding your inquiry - When you mention "footer", do you mean a semantic footer layout for the main page or menu, or perhaps a footer for a list-view controller? The response hinges on your specific requirements, so please provide some code of what you've already accomplished and what you aim to accomplish.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Changes to the value of an Angular FormControl will automatically trigger changes in the entire formgroup

When attempting to validate the uniqueness of a user's email through an API call, I encountered a problem where any changes in form controls would trigger the value change. Below is my code: Errors(){ this.form01.valueChanges .subscribe((changed ...

Error message in my Angular project: Invalid Target Error

Out of nowhere, I encountered an invalid target error while running my Angular project with the command: npm start An unhandled exception occurred: Invalid target: {"project":"agmbs","target":"build","configur ...

Navigating through an array in Angular 5: a guide

This question may seem simple, but I'm having trouble figuring it out. Here is the code snippet I am working with: getInstabul(): void { this.homeService.getWeather() .subscribe((weather) => { this.instanbulWeathers = weather ...

Tips for preventing the exposure of internal components in Angular

Imagine an OutlookBarComponent that contains various bars similar to those seen in Microsoft Outlook. Each bar has a child component called OutlookBarItemComponent. Both the OutlookBarComponent and OutlookBarItemComponent are encapsulated within the Contro ...

What is causing the element to disappear in this basic Angular Material Sidenav component when using css border-radius? Check out the demo to see the issue in action

I have a question regarding the Angular Material Sidenav component. I noticed that in the code below, when I increase the border-radius property to a certain value, the element seems to disappear. <mat-drawer-container class="example-container" ...

Issue encountered when using createReducer/handleAction in Redux along with TypeScript and typesafe-actions: Invalid argument provided for Argument 1

I tried following the guide on typesafe-actions in order to set up a basic TypeScript/Redux project, but I'm encountering issues. Whenever I attempt to access the page, I keep getting this error message, Error: Argument 1 is invalid, it should be an ...

Encountering TS2339 error while attempting to append a child FormGroup within Angular framework

I'm currently working with Angular8 and facing an issue while attempting to include a child FormGroup to a form using the addControl method: this.testForm = new FormGroup({ id: new FormControl(0), people: new FormGroup({ } ...

A guide to effectively converting and parsing a class object that includes Uint8Array elements

After stringifying a class object that contains a property in Uint8Array, and then parsing it later, the property is no longer in Uint8Array format. Here's an example: class Example { title:string; byteData:Uint8Array; ...

Which is more powerful: Angular's change detection or directly editing HTML?

One thing I've heard is that Angular's change detection can potentially cause lag in an application when receiving a large amount of data from a websocket. In my setup, the data comes from the socket, updates a variable in the component, and then ...

What is the process of associating components with a specific tag in Angular?

Here is the structure of my angular-electron application that I'm currently working on. Take a look at it here. Within the dynamic area or tag, I aim to bind various components based on the selection of list items in the side-nav component. These com ...

The intended 'this' keyword is unfortunately replaced by an incorrect '

Whenever the this keywords are used inside the onScroll function, they seem to represent the wrong context. Inside the function, it refers to the window, which is understandable. I was attempting to use the => arrow notation to maintain the correct refe ...

Encountering a Typescript error while attempting to iterate through Enum keys for generating JSX components

I'm really struggling with this problem. Here's a simple enum I have: export enum depositTypes { ACH = 42, Wire = 36, Check = 3, Credit = 2, } I'm trying to create option tags for a select element, like so: Object.keys(depositTyp ...

Typescript and React encounter an error when trying to call a nested map function, stating that this expression is

Currently, I am working on a project using Typescript with React and encountering an issue with returning JSX from a function. Generally, I have not faced any problems with a nested map loop, but for some reason, I am getting an error when using Typescript ...

The React TypeScript MUI Autocomplete is giving an error: "Type 'Product[]' cannot be assigned to type 'readonly never[][]"

Having trouble with a ReactJS useEffect hook in an Autocomplete field while using Typescript version 4.9.5. The VS code editor is flagging an error on the line options={products}. Any assistance on resolving this issue would be greatly appreciated. You c ...

Angular's Spanning Powers

How can I make a button call different methods when "Select" or "Change" is clicked? <button type="button" class="btn btn-default" *ngIf="!edit" class="btn btn-default"> <span *ngIf="isNullOrUndefined(class?.classForeignId)">Select</spa ...

Retrieve the specific type of property from a generic data structure

I am currently working on a project where I need to determine the type of property within a given Type: type FooBarType { foo: string, bar: number } The function would be structured like this: getType<K extends keyof T>(key: K): string. The ...

How about integrating Angular with Firebase and Node JS?

At the moment, I am utilizing Angular in conjunction with Firebase for authentication and data storage. My goal is to send emails to users directly through Angular. However, I came across a method that involves using Node.js to send emails. Is it feasibl ...

Upon attempting to send an HTTP POST request from Angular to Node using Express.js, the operation became stuck with a status 204 indicating no content. The

I'm currently using client-side Ionic with server-side Node.js + Express.js for testing on my local computer. While I can successfully do a POST request using Postman, I am facing difficulties making it work through Ionic. Investigation I have spen ...

Express is encountering an issue where it is unable to interpret the property 'name' of an undefined element coming from

I am attempting to create a fullstack application using Node.js and Angular with Material UI. I have encountered an issue while working on my web resource management application. Currently, I am facing an error during the registration and data submission ...

Implementing Boolean filtering on arrays in Angular

Greetings! As a beginner in Angular, I am currently exploring ways to sort an array generated using *ngFor. My goal is to utilize input checkboxes for filtering. I have added properties to the objects such as... PersonalInvestment: boolean; This property ...