Javascript - Մոդուլներ (Modules)
Вставка
- Опубліковано 23 бер 2021
- Հղումներ
----------------
Javascript դասընթաց: • Ծրագրավորման Արվեստ | ...
Ֆեյսբուքյան էջ: / roubenmeschian
Ֆեյսբուքյան խումբ: / 1647352038759065
Կոդերի խմբագիր: roubenmeschian.com/editor/
ինչպես միշտ, շատ պարզ ու գրագետ բացատրություն, շնորհակալություն 👏․․․ոնց դուք եք ասում, անպայման ստացվելու ա
Ռուբեն ջան , շատ - շատ Շնորհակալություն ձեզ ))
Shnorhakal em!
Mersi ruben jan 😘😘😘
հարգելի Ռուբեն շատ շատ շնորհակալ եմ ձեզանից
Hargeli Artyom jan, shat shat mets sirov)
Thanks👌
👏🏼👏🏼👏🏼
Meschiany mnuma Meschian eli😘😘😘
հիանալի վիդեոներ հայերենով
Mersi axpers shaaattt
Rouben jan html um baci tegy urish ban grvelu a vor henc modulenerin a verabervum vor ashxati?? Cannot use import statement outside a module a talis
Ruben jan, erb import ev export em anum, ayspisi error e berum (Failed to load resource: the server responded with a status of 404 (Not Found)), inchic klini?
chi gtnum module@. Network tabum (chrome dev toolsi mech) naek tesek inch e portsum berel - vor hastseov e portsum kashel file@ vor chi gtnum
barev dzez Ruben jan , vor xndrem mi hat video kaseq es webpack@ karoxanam ogtagorcel, grumem npx webpack ,asuma install ara
"npm install -D webpack-cli" esi, eselem anum el ban chi asum vonc anem
ua-cam.com/video/MpGLUVbqoYQ/v-deo.html
Ruben jan, mi hat harc unem 19:23 dzer asaci pes anum em es a berum - Do you want to install 'webpack-cli' (yes/no):
Ashot jan, entrek 'yes', erevi inchvor ban poxvel e...
Ruben jan es vonc pordzumem vochmi dzev chi stacvum inchic klini xndire ?
Narek jan, djvar e asel ayspes...
Rouben jan export default i jamanak arrow function chenq kara ogtagorcenq? orinak senc ..... export default const bi = () => console.log('hii')
ay senc errora talis '' (Uncaught SyntaxError: Unexpected strict mode reserved word (at hello.js:10:20))''
const bi = () => console.log('hii')
export default bi;
ay senc exav u ashxatec...
const bi = () => console.log('hii');
export default bi;
Եթե մեր կոդը main.js-ումա պահպանում կարանք index.js ու hello.js ֆայլերը ջնջենք ու միայն main.js ֆայլը օգտագործենք?
Erik jan, et jamanak amboxj npatak@ arandznatsnel code@ fileneri kkori.
@@meschian մերսի շատ
Ruben Jan barev dzez es pordzeci export anel I'm fukcianern u popoxakanner@ u heto mek ail js format faili mej import areci.. Stugeci baic chi asxatum et tiruytum. ham sintaxn e jhisht grvac ham janaparhne jhisht nshvac inchic klini vor anhasaneli en?????
Gurgen jan, ayspes djvar klini indz haskanal xntir@. Xntrum em texadreq dzer project@ githubum ev greq aystex projecti hxum@ vor es kashem ev naem.
porci erku js ejerum save anel. im moteler nuyny parzvec export aneluc moranum em save anem. karoxa qo motela nuyn xndiry
Ruben jan ete es unem inch vor dom-i logika, karox em et amen inchy patetavorel inch vor function-i mech u miangamic iran export anel?, orinak espes:
export function func() {
const canvas = document.querySelector('canvas');
canvas.addEventListener('click', () => canvas.width = '600')
}
func()
Ayo). Bayts che haskatsa inchu amichapes kanchetsik func functionin. Ok e da, ete uzum eq amichapes ashxati function@…
@@meschian Ayo es uzum em vor anmichapes ashxati, isk backend cragravoroxi mot inch vor xndir karajana ete function-ic durs vochinch hasaneli che?
Che, da lav e vor functionits durs hasaneli chen. Da nshanakum e karox eq logika taktsnel mnatsats systemits (encapsulation) - da lav ban e :)
@@meschian Lav, shat shnorhakal em patasxani hamar)
Mersi axpers||||
Es reacti het kap uni bayc?
Ha jan, shutov ktesneq inchpes.
@@meschian
Mersi Ruben jan
mersi shat lavner
mek harc karox enq senc ban grel
defaultic export anenq ayn principov vorvo vor anun enq uxaki exportic
export default {
foo,
sayHi,
Dog
}
Ayo, kareli e
+++
aysinqn erb menq scripti type-@ jnjum enq,mievnuyn e impot u export@ toxnum enq?
ayo ayo
mescian jan vor xntrem pattern i u async i masinel video kgces?
Apagayum)
Unexpected token 'export'
Էս խնդիր ինչ սխալից կառաջանա։
Մերսի շատ
Armen jan, export menak karox eq ogtagortsel en jamanak erp browser@ giti vor modulner eq ogtagortsum. Ete tents ban e asum, uremn che giti. Duq vonts eq ogtagortsum? grel eq ?
@@meschian հա body ի մեջ
Իսկ մի բան հարցնեմ, կարա՞մ մի ֆոլդրի մեջ երկու հատ export default ավելացնեմ,
Ayo. Mi folderi mech karox eq mikani file dneq, amen mek@ ir export default unena
Ruben jan live server vonc karoxenq mtnel indz mot chi talis live serveri tex
@@meschian aysinqn chaskaca knereq?
ua-cam.com/video/yppckv8CSd4/v-deo.html
Windows PowerShell
Copyright (C) 2016 Microsoft Corporation. All rights reserved.
PS C:\Users\Davit\Desktop> npx webpack
npx : The term 'npx' is not recognized as the name of a cmdlet, function, script file, or operable program. Check
the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ npx webpack
+ ~~~
+ CategoryInfo : ObjectNotFound: (npx:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
PS C:\Users\Davit\Desktop>
senc patuhana bacvum;
Davit jan, portseq heteval Vardan Makaryani commentin ays videoi tak: ua-cam.com/video/fp9CdYRczPI/v-deo.html
parcel-bundler օգտագործի webpack-ի տեղը )))) կոնֆիգի կարիք չկա
Shat lav, merci Sam jan
@@meschian ինքը նույն webpackի սիստեմն ա, հիմքը webpack ա հենց
aha, cool
տղեր՜ք, ոոոոնց ենք մենք ձեզնից շնորհակալ ) լավ ա որ մի տեղ եք հավաքվել )
Ruben jan im mot es xndirna talis
npx : Имя "npx" не распознано как имя коман
длета, функции, файла сценария или выполняе
мой программы. Проверьте правильность напис
ания имени, а также наличие и правильность
пути, после чего повторите попытку.
строка:1 знак:1
+ npx webpack
+ ~~~
+ CategoryInfo : ObjectNotFou
nd: (npx:String) [], CommandNotFoundEx
ception
+ FullyQualifiedErrorId : CommandNotFo
undException
Ruseren lav chem haskanum :(
@@meschian npx webpack
npx : The term 'npx' is not recognized as the name of a cmdlet, function, script file, or operable program. Check
the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ npx webpack
+ ~~~
+ CategoryInfo : ObjectNotFound: (npx:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
@@meschian nerqevum eli tesa urishi motela tenc xndir exel Rub jan u du iran patasxanel es (Davit jan, portseq heteval Vardan Makaryani commentin ays videoi tak) bayc qo uxarkac videoi tak Vardan Makaryan chgta vor commenta grel
Ruben jan es harcin patasxani eli axper xia senc berum,im motela nuyn xndir@:
Access to script at 'file:///C:/Users/Gagas/Desktop/Lesson%20JS/script.js' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, isolated-app, chrome-extension, chrome, https, chrome-untrusted.
Ruben jan im mot consolum senca bacum,inchic klini??
File@ browserov amichapes mi batseq. Ogtagortseq server
Access to script at 'file:///F:/MyProject1/js/das29/index.js' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, https, ipns, chrome-untrusted, ipfs, data, chrome, chrome-extension.
errora talis chi stacvum 2 hat es arajina es el erkrordna
Access to script at 'file:///F:/MyProject1/js/das29/index.js' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, https, ipns, chrome-untrusted, ipfs, data, chrome, chrome-extension.
Gevorg jan, module ogtagortselu hamar petk e server ogtagortseq. Orinak et 'live server' extension@ VSCodei mech vor@ es videoi mech ogtagortsum em.
Sa e batsatrutsun@: ua-cam.com/video/yppckv8CSd4/v-deo.html