javascript - what is meaning of Dot(.) in angular import statement -


i new angular 2 , following angular 2 quick start guide. trying understand directory structure of angular app . using npm build app . came across import statements in angular 2

e.g.

import {ngmodule} '@angular/core'; 

i found sytemjs.config.js file mapped

'@angular/core': 'npm:@angular/core/bundles/core.umd.js' 

where

'npm:': 'node_modules/' 

npm: alias node_module folder.

but when using custom component(made user) , imports like

import {appcomponent} './app.component'; 

what dot(.) represent here ,is representing app folder mapped

app: 'app', 

the dot has nothing angular, means current directory.

for example, if have 2 files this

app   file1.js   file2.js 

and inside app/file1.js:

import './file2' 

this tell module loader file2.js in app directory because current directory of file1.js.

you can use .. parent directory.

here's explanation dot definition, obtained rahul tripathi:

on unix-like operating systems every directory contains, minimum, object represented single dot , represented 2 successive dots. former refers directory , latter refers parent directory (i.e., directory contains it). these items automatically created in every directory, can seen using ls command -a option (which instructs show of contents, including hidden items).


Comments

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -