Coder Social home page Coder Social logo

nativescript / docs-v7 Goto Github PK

View Code? Open in Web Editor NEW
446.0 59.0 460.0 89.15 MB

Documentation, API reference, and code snippets for NativeScript

Home Page: https://docs.nativescript.org

License: Apache License 2.0

Ruby 8.99% JavaScript 17.89% CSS 51.43% HTML 18.18% Shell 3.14% Dockerfile 0.37%
nativescript docs angular javascript mobile android ios

docs-v7's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docs-v7's Issues

Console.log

Describe where does the console.log statement output its results

"Requesting permission to use location service" javascript snippet is not valid, page unclear.

The location documentation has a javascript snippet which is mostly typescript - it crashes the ios emulator:

var buttonModule = require("ui/button");
var appModule = require("application");
var platformModule = require("platform");

var onRequestButtonTap = function(args: observable.EventData) {
    var button = <buttonModule.Button>(args.object);
    if (button.android) {
        console.log("Application run on Android");
        (<android.app.Activity>appModule.android.currentContext).startActivityForResult(new android.content.Intent(android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS), 0);
    }
    else if (button.ios) {
        console.log("Application run on iOS");
        if (platformModule.device.osVersion.indexOf("8") === 0) {
            console.log("iOS version is greater or equal to 8.0");
            var iosLocationManager = CLLocationManager.alloc().init();
            iosLocationManager.requestWhenInUseAuthorization();
        }
    }

Further to this, this whole section is not as clear as it might be - it took me some time to decipher. I think it could be more obvious with an end-to-end example. The following is a suggested structure for the page:


Configure a location service for the application

To enable location services it is first required to configure a location service in the respective application bundles:

For an IOS 8.0+ project:
Add one of the two following snippets to <applicationName>-Info.plist depending on your business needs:

<key>NSLocationAlwaysUsageDescription</key>
<string>Your message goes here</string>

<key>NSLocationWhenInUseUsageDescription</key>
<string>Your message goes here</string>

In an Android project:

<android example/instructions>

Request permission to use the location service

Next, a request to use the location service is required. Unfortunately... (section as it stands with corrected javascript snippet above)...

Getting a location

Either point to, or move the HOW-TO page to this location in the interests of DRY. The HOW-TO page seems clearer, and contains more information (with less words).

Better language separation

The blocks of JavaScript and TypeScript are very similar in nature, and when next to each other do not always show the language type: https://github.com/NativeScript/docs/blob/master/ui-with-xml.md#declaring-application-mainmodule-and-start-the-application

Would you accept a PR for adding a language declaration above or in the language example block?

Example proposed:

Navigate to page using Frame navigate() method

JavaScript

// Navigate to page called “my-page”
frames.topmost().navigate("app/my-page")

TypeScript

// Navigate to page called “my-page”
frames.topmost().navigate("app/my-page")

General Request For Timely Updates in Official Documentation

It really would be nice if the official documentation is updated in a timely manner based on changes --- especially breaking changes --- implemented in every version update/release.

For example, in the Application Management section, the supposedly obsolete "local-settings" module is still referenced in the text and sample code under "Persist and Restore Application Settings".

Trivial errors on some sentences in core-concepts/bindings.md

A few trivial typos and errors in some sentences:

  • "... your code has ,et the following requirements ...".
  • "... target property should to be a dependency property ...".
  • "... as in the exmple above ...".
  • "... could be omited ...".
  • "... of progating changes ...".

Document creating release builds and/or submitting to app stores

Currently there is no documentation on how to create a release build, or how to submit an app to the app stores. IMO we should have a page that shows the basic process, starting with using the --release flag. For things out of our control (Application Loader, iTunes Connect, Google Play Developer Console, etc), we could at least give people links to point them in the right direction.

Styling.html Page.css clarification request

Based on reading the source code and some experiments, I believe the documentation at http://docs.nativescript.org/styling.html#page-specific-css is a bit faulty. It does not appear to be clear that if you attempt to set the Page.css property you are actually eliminating all CSS except the Application wide CSS. So if you use Page.addCss="..." or Page.addCssFile(...) and then do a Page.css = "..."; you will wipe out any and all other css that was added via all the prior calls.

Styling: Describe “device-independent units”

Our styling docs use the term “device-independent units”, but we never really explain what that term means.

I think we should add a small section in the styling docs to explain how, for example, margin: 5 actually gets applied in iOS and Android.

How to build the docs

Is there a way to build nativescript docs in html or to build them similar to docs.nativescript.org ?

Document XAML-like sizing system

As described in this issue, the sizing of e.g. a a GridLayout's cols/rows can be set by a XAML-like sizing system, like "*, 3*, *". I haven't found this documented anyway and it's really a hidden gem as we quite often want to have non-pixel-sizing.

Broken links in README.md

The iOS- and Android-specific links at the bottom of index.md are broken. I'd fix them but I'm not sure where they should link to.

HTTP vs. HTTPS in API URL for backend grocery service

Section 4.0 of the docs refers to the hard-coded API URL that utilizes HTTP:

module.exports = {
    apiUrl: "http://api.everlive.com/v1/GWfRtXi1Lwt4jcqK/"
};

But the app employs HTTPS in the config.js file for both the start and end branches.

If a user thought to change HTTPS of the repo to HTTP - to follow the docs - then you obtain the "Unfortunately we could not find your account" dialog and the following log:

2015-11-03 09:35:08.155 sampleGroceries[5287:133749] App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app's Info.plist file.
file:///app/views/login/login.js:26:24: CONSOLE LOG TypeError: Network request failed

Perhaps the docs should be updated to reflect HTTPS?

Merge all the Changelogs into one

Lets start to have only a single Changelog for all the repos, as currently there is no a single place where to point customers to see the changelog for a particular version.

An easy to implement idea is to just have a placeholder article that links to the existing changelogs.

http request

mainViewModel.testButton = function () {
    var http = require("http");
 http.getJSON("http://httpbin.org/get").then(function (r) {
    alert(JSON.stringify(r))
}).fail(function (e) {
    // Argument (e) is Error!
    alert("Failed")
});
}

when i click on button application is getting crashed. I changed the button action to a string alert, it worked. So i made some mistakes in http request part it seems.

One changelog to rule them all

I'd like to suggest that there be a single changelog file that lives at http://docs.nativescript.org/Changelog, and that links to the more detailed changelogs (CLI, runtimes, and modules).

My reasoning is we really need a single place we can link to in order to show people exactly what changed in a given release. For instance it'd be great if @NativeScript could tweet out, “1.1 is out! Here's what changed: http://docs.nativescript.org/changelog.

Ideally this “base” log could also give a three or four bullet summation of the release's major features, and again link to the more detailed changelogs or GitHub issues for more details.

cc @ligaz

GridView and its HOW-TO doc example uses ".setColumn" which doesn't exist anymore. Please provide a real example!

Hi,

https://docs.nativescript.org/ApiReference/ui/layouts/grid-layout/HOW-TO.html is completely confusing as discussed in https://groups.google.com/forum/#!topic/nativescript/O-uimQ4GDDE .

Also it uses .setColumn which doesn't exist anymore, so the actual example in there is broken ("gridLayout.setColumn(button1, 0);" etc.).

An example that actually shows how it works would be greatly appreciated. Please make it for mor than one row, so that one of the most unclear points, which is how to feed the GridView with cells across rows, is done.

Also http://docs.nativescript.org/ApiReference/ui/layouts/grid-layout/GridLayout.html claims that .setColumn exists which it does not, so it should be removed!

And perhaps the same document should mention something so the reader can understand how data is fed to it.

(Trying to run .setColum gives the error "gridLayout.setColumn is not a function".)

Thanks!
Mike

Examples?

Hi,

Are there any ready-to-compile example apps?

-G

Can't connect with [email protected] account

When i was following the nativescript guide (sample groceries) I couldn't visualize the list that supposely is contained in the [email protected] account. I was checking for any errorcode in the views models.js (grocery-view-model and user-view-model...). So i want to know how can I visualize it.

Thanks in advance.

Anargu

visual examples

It would be great, that screenshot is displayed to show how it would look as an example. Since there are no known functions as shown.

Please Improve Data Binding Documentation

Data binding is such an important feature in NativeScript and key to understanding its power.

Is it okay for the Documentation Team to find time to revisit the "App: Data Binding" doc and make it just a little bit easier to understand, especially the "Using expressions for bindings" section?

Thanks guys!

fetch.fetch http return network request failed. Need more info on error

This request work fine under ionic mobile app using angular js http but never works in nativescript.

            var url = "http://localhost/MySpecial.Authorisation.API/api/audience/SetClient";
    debugger;
    fetch.fetch(url, {
        method: "POST",
        headers: { "Content-Type": "application/json" },
        body: JSON.stringify({ UserName: "SuperUser", Password: "SuperUser"  })
        }).then(function (r) { 
            return r.json(); 
        })
        .then(function (r) {
            console.log(result);
        }, function (e) {
            console.log("Error occurred " + e);
        });

Getting Started Guide - Rob's edits

  1.   Android Setup:
    
    a. As a not-so-regular Mac user I was confused by having to alter my PATH all the time (in fact, one time I altered my PATH variable and screwed up what had been done by Gradle for me, odd). Ideally you would put literal commands in there based on the latest versions of all the tools (difficult to keep up to date, but for idiots like me it can be critical!).
    b. “Android Support Repository” package didn’t exist in my ADK tool list, FYI.
  2.   {N} CLI:
    
    a. Prior to installing the NS CLI, I had to uninstall node, delete the node_modules directory, and reinstall it. Probably not related to anything prior, but it happened to me.
  3.   Detour: How do I know which {N} modules I need in my code? This always has irritated me. I’d love some guidance on when I need to require which modules in KB doc.
    
  4.   [3.2] For me, anything output in console.log doesn’t show up in the terminal, but rather in the system.log in the simulator.
    
  5.   [4.3] “load function empties the list” à should be “empty function” I think
    
  6.   [4.5] Instructions there to “open list.js” and add some xml à should be list.xml
    
  7.   [5] minor spelling issue on “install and use and external…”
    

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.