var mag = {};
mag.funName=function(fun){
var ret = fun.toString();
  ret= ret.substr('function '.length)
  ret =ret.substr(0, ret.indexOf('('));
  return ret;
};
mag.instance=function(fun){
  name=mag.funName(fun);
  this.controls = this.controls || {};
    this.controls[name] = this.controls[name] || {};
  return name;
}
mag.tape=function(modelsArray,fun){

 name=mag.instance(fun);
   var $scope = this.controls[name];
   args = modelsArray || [];
    args.splice(0, 0, $scope);
  
  //$(document).trigger('preLoad-');
  fun.apply(this,args);
console.log($scope);
};

var t=function TodosWidget($scope){

  $scope.test=1;
 
};

mag.tape(['item','anothjer'],t);

@@ -1,30 +1,85 @@
-var mag = %7B%7D;%0Amag.fun
+;(function( namespace, undefined )%7B%0A    // public method%0A    namespace.get
 Name
-=
+ = 
 func
@@ -87,116 +87,433 @@
 ion(
-fun)%7B%0Avar ret = fun.toString();%0A  ret= ret.substr('function '.length)%0A  ret =ret.substr(0, ret.indexOf('('))
+obj)%7B%0A      for(key in this)%7B%0A      if(obj === this%5Bkey%5D) return key; %0A      %7D%0A    %7D%0A    namespace.getScope = function(name)%7B%0A      return this.controls%5Bname%5D%7C%7C%7B%7D;%0A    %7D%0A%7D)( window.mag = window.mag %7C%7C %7B%7D);%0A%0Amag.options=function(options)%7B%0A  var a=%5B%5D,modelsArray=%5B%5D;%0A  for(k in options)%7B%0A    if(typeof options%5Bk%5D == 'function')%7B%0A      a%5B0%5D=options%5Bk%5D;%0A    %7Delse%7B%0A      modelsArray.push(options%5Bk%5D);%0A    %7D%0A  %7D%0A  a%5B1%5D=modelsArray
 ;%0A  
@@ -523,15 +523,12 @@
 urn 
-ret
+a
 ;%0A%7D
-;
 %0Amag
@@ -550,38 +550,16 @@
 ion(
-fun)%7B%0A  name=mag.funName(fun);
+name)%7B%0A 
 %0A  t
@@ -594,18 +594,16 @@
  %7C%7C %7B%7D;%0A
-  
   this.c
@@ -649,22 +649,8 @@
 %7B%7D;%0A
-  return name;
 %0A%7D%0Am
@@ -670,33 +670,51 @@
 ion(
-modelsArray,fun)%7B%0A%0A name=
+name,options)%7B%0A  a=mag.options(options);%0A  
 mag.
@@ -726,15 +726,15 @@
 nce(
-fun
+name
 );%0A
- 
   va
@@ -748,50 +748,41 @@
 e = 
-this.controls%5B
+mag.getScope(
 name
-%5D
+)
 ;%0A  
- 
 args = 
-modelsArray
+a%5B1%5D
  %7C%7C 
@@ -787,18 +787,16 @@
 %7C %5B%5D;%0A  
- 
- 
 args.spl
@@ -819,14 +819,11 @@
 );%0A 
- 
 %0A  
-//
 $(do
@@ -843,25 +843,36 @@
 er('
+mag-
 pre
-L
+l
 oad
--
 '
+,%5Bname%5D
 );%0A  
-fun
+a%5B0%5D
 .app
@@ -890,122 +890,68 @@
 s);%0A
-console.log($scope);%0A%7D;%0A%0Avar t=function TodosWidget($scope)%7B%0A%0A  $scope.test=1;%0A %0A%7D;%0A%0Amag.tape(%5B'item','anothjer'%5D,t)
+  $(document).trigger('mag-postload',%5Bname%5D);%0A  return name;%0A%7D
 ;%0A

Update mag.js