Giter Site home page Giter Site logo

nathanwalker / nativescript-rootlayout-demo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from williamjuan027/nativescript-rootlayout-demo

0.0 2.0 0.0 4.88 MB

🤹 Demo for Nativescript 8's RootLayout Component

TypeScript 69.63% CSS 6.13% HTML 23.29% JavaScript 0.67% Shell 0.28%

nativescript-rootlayout-demo's Introduction

RootLayout Demo

🤹 Demo for Nativescript 8's RootLayout Component

Sample iOS

Development

This app is built with the NativeScript CLI. Once you have the CLI installed, start by cloning the repo:

git clone https://github.com/williamjuan027/nativescript-rootlayout-demo.git

cd nativescript-rootlayout-demo/ng-demo

Install the project's dependencies

npm install

You can then run the app on iOS and Android using the following commands:

npm run start.ios

npm run start.android

This app uses the new RootLayout component from Nativescript 8 which is still curently in alpha, make sure that the latest Nativescript alpha is installed prior to running the app

npm install -g nativescript@alpha

How to Use RootLayout

RootLayout is meant to be used as the outermost container for your app. In Angular, this refers to the layout in your app.component.html which contains your page-router-outlet and other UI elements.

<!-- app.component.html -->
<RootLayout>
  <page-router-outlet></page-router-outlet>
</RootLayout>

RootLayout related functionalities are handled in ui.service.ts

RootLayout Methods

getRootLayout() returns the RootLayout instance which has the following methods:

Method Description
open(view: View, options?: RootLayoutOptions): Promise Opens the target view
close(view: View, exitTo?: TransitionAnimation): Promise Closes the target view
bringToFront(view: View, animated?: boolean): Promise Moves the target view to the front (highest z-index)
getShadeCover(): View Returns the shade cover instance

nativescript-rootlayout-demo's People

Contributors

codephobia avatar edusperoni avatar lukas-eschstruth avatar nathanwalker avatar pebblecreek avatar williamjuan027 avatar

Watchers

 avatar  avatar

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.