Angular 4 documentation offline computer [closed]
Asked Answered
R

6

10

I would like to find a local/offline version of the Angular 4 documentation (https://angular.io/docs), that I could use in an offline environement (no internet access at all, zeal and its alternatives) could not be used unfortunatly.

After many hours of searches it seems that nobody could find a simple solution for this task, only for the angularJS 1.0 version..

I have also tried cloning the angular documentation project without success on running it locally without internet available.

Romaromagna answered 2/10, 2017 at 19:13 Comment(3)
with chrome, you can save locally each page on your disk. But it's tedious as you will have to do it for every page you need. right click and hit save as, select page completeClaustral
yes, I'd prefer a more convenient solution :)Romaromagna
If you use firefox you can use this addon Angular Doc Offline ..it fetches angular site and caches it on your browser so you can browse it offlineThrust
G
16
  1. Go to DevDocs.io this website first
  2. Then go to Preference from Menu
  3. Check item that you want to get in list and click Apply enter image description here
  4. Then go to Offline from Menu and install all documents those you want to see on offline.
  5. That's all !!! Now you can see that even in offline.
Gotcher answered 22/2, 2018 at 11:12 Comment(0)
F
1

Go to the page you want and print it in tools sections or press ctrl+p and save it as pdfTo print as PDF

Fourthclass answered 17/1, 2018 at 9:54 Comment(0)
L
1

for persons who dosn't know what zeal is ? offline desktop application for languages and frameworks documentation you can dwonload zeal desktop application from the link below :

https://zealdocs.org/download.html

it works offline ! and you can download whatever you want to access it in offline mode

enter image description here

Lying answered 13/9, 2018 at 10:47 Comment(2)
The OP clearly mentions he does not intend to use zeal in his environment.Peper
i didn't see that, however it could help other persons who doesn't know zeal method.Lying
M
0

if you use angular-cli, you can build an angular 4 project using ng build . In your "dist" directory you have all the files you need.

If you open the "index.html" in a navigator you can execute the project. If you have a IIE server you can create a empty Web site

IMPORTANT: if you don't use a server, after execute ng build --prod you must be edit de index.html and change "base" and close tag script (you can change the names of .js too)

<!doctype html>
<html lang="en">
<head>
    <meta charset="utf-8">
        <title>AppNew</title>
        <base href="/Users/Usuario/Documents/app-new/dist/">
        <link rel="icon" type="image/x-icon" href="favicon.ico">
          <link href="styles.css" rel="stylesheet"/>
    </head>
    <body>
        <app-root/>
        <script type="text/javascript" src="inline.js"></script>
        <script type="text/javascript" src="polyfills.js"></script>
        <script type="text/javascript" src="vendor.js"></script>
        <script type="text/javascript" src="main.js"></script>
    </body>
</html>
Miltie answered 2/10, 2017 at 19:51 Comment(4)
can you please add more information? Do you mean that I need to clone the docs as i mentioned in my question?Romaromagna
Completed my answerMiltie
hey, still could not get it.. could you please explain step by step what to do? the final result will be a kind of local site of angular.ioRomaromagna
Sorry for delay. I'll think that it's possible, but there are a problem: the routes. You must use a HashLocationStrategy. see my example in the answerMiltie
M
0
//app.module.ts
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { HashLocationStrategy,LocationStrategy,CommonModule } from '@angular/common';

import { AppComponent } from './app.component';
import { HomeComponent } from './home/home.component';
import { WellcomeComponent } from './wellcome/wellcome.component';

const appRoutes: Routes = [
  { path: '', component: HomeComponent },
  { path: 'wellcome', component: WellcomeComponent },
  {path: '**', redirectTo: '', pathMatch: 'full' }
]
@NgModule({
  declarations: [
    AppComponent,
    HomeComponent,
    WellcomeComponent
  ],
  imports: [
    BrowserModule,
    CommonModule,
    RouterModule.forRoot(appRoutes)
  ],
  providers: [
    { provide: LocationStrategy, useClass: HashLocationStrategy }
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }

the app.component.ts

//app.component.ts
import { Component } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';

@Component({
  selector: 'app-root',
  template:`
  <div style="text-align:center">
  <p>
  <a [routerLink]="['/']">Home</a>
  </p>
  <p>
  <a [routerLink]="['/wellcome']">Wellcome</a>
  </p>
  <h1>
    Welcome to {{title}}!
  </h1>
</div>
<h2>Here are router-outlet: </h2>
<router-outlet></router-outlet>`,
})
export class AppComponent {
  title = 'app';
}

the wellcome.component.ts

//wellcome.component.ts
import { Component, OnInit } from '@angular/core';

@Component({
  selector: 'app-wellcome',
  template:`
  <p>
  wellcome works!
</p>
  `
})
export class WellcomeComponent implements OnInit {

  constructor() { }

  ngOnInit() {
  }
}

the home.component.ts

//home.component.ts
import { Component, OnInit } from '@angular/core';

@Component({
  selector: 'app-home',
  template:`
  <p>
  home works!
</p>
  `
})
export class HomeComponent implements OnInit {

    constructor() { }

  ngOnInit() {
  }
}

after you do ng build --prod you must edit the index.html replacing by document.write("")

Index.html will be like

<!doctype html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <title>AppNew</title>
        <script>document.write("<base href='"+window.location.href+"'/>") </script>
        <meta name="viewport" content="width=device-width,initial-scale=1">
        <link rel="icon" type="image/x-icon" href="favicon.ico">
        <link href="styles.d41d8cd98f00b204e980.bundle.css" rel="stylesheet"/>
    </head>
        <body>
            <app-root/>
            <script type="text/javascript" src="inline.2833f8af5a9f1ba869e4.bundle.js"/>
            <script type="text/javascript" src="polyfills.8eba0ab53b5457105d75.bundle.js"/>
            <script type="text/javascript" src="vendor.aeea1adcdc349547d6f1.bundle.js"/>
            <script type="text/javascript" src="main.c39d8a271dce22bb4c5c.bundle.js"/>
    </body>
</html>
Miltie answered 13/10, 2017 at 10:33 Comment(0)
A
0

This method is little tricky but it works. You only requires google chrome browser to download offline version of angular.io website. The steps are as follows:

  • Open angular.io in chrome browser.
  • Open all the pages at least once that you wanted to be available for offline reading. The pages will cached in browser.
  • Now goto More tools > Add to Desktop and click add.

Add To Desktop

Your offline version of angular.io is on desktop. Try it after disconnecting from the internet.

Note: If you have not opened all the pages before step 3. There is no problem. Reconnect to internet and open all those links in the added shortcut on the desktop.

Amaranth answered 2/1, 2018 at 13:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.