Skip to content

Commit

Permalink
Reusando modulo con MAP
Browse files Browse the repository at this point in the history
map nos permite agregar alias a rutas locales y reutilizarlas
1.- agregamos map a reuirejs-config , creamos alias y le asignamos el path
2.- el alias creado en map ahora lo usamos para hacer referencia a al modulo en nuestro phtml
  • Loading branch information
PerezContrerasLuis committed Jun 26, 2022
1 parent b132296 commit f0940f6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion code/JavaScriptDev/JsFun/view/frontend/requirejs-config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
var config = {

"map":{
"*":{
"fadeInElement":"JavaScriptDev_JsFun/js/fade-in-element"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script>
require(['jquery','JavaScriptDev_JsFun/js/fade-in-element'],function($,fadeInElement){
require(['jquery','fadeInElement'],function($,fadeInElement){
'use strict'

$(function(){
Expand Down

0 comments on commit f0940f6

Please sign in to comment.