material icon indicating copy to clipboard operation
material copied to clipboard

How this datepicker works without adding ngMaterial as depdency?

Open sajeetharan opened this issue 10 years ago • 1 comments

Actual Behavior:

  • What is the issue? * The following datepicker works without adding ngMaterial as dependency

  • What is the expected behavior? It should not work without adding ngMaterial as a dependency

CodePen (or steps to reproduce the issue): *

  • CodePen Demo which shows your issue:
  • Details:

http://codepen.io/sajeetharan/pen/GNENEx

Additional Information:

  • Browser Type: *
  • Browser Version: *
  • OS: *
  • Stack Traces:

Shortcut to create a new CodePen Demo. Note: * indicates required information. Without this information, your issue may be auto-closed.

Do not modify the titles or questions. Simply add your responses to the ends of the questions. Add more lines if needed.

sajeetharan avatar Nov 24 '16 11:11 sajeetharan

Actually, 'ngMaterial' is being loaded as a dependency on another file at the end on that codepen: https://s3-us-west-2.amazonaws.com/s.cdpn.io/t-114/assets-cache.js

var demoExampleAppName = 'MyApp';
  angular.module(demoExampleAppName, ['ngMaterial', 'ngMessages'])
    .run(function($templateCache) {
      angular.forEach(assetMap, function(value, key) {
        $templateCache.put(key, value);
      });
    });

And on your js file, you're only loading that already existing module:

angular.module('MyApp')

Check the documentation for modules for more info

Drumarcco avatar Nov 24 '16 22:11 Drumarcco