title: Simplest way to pass data into directive Angular JS
body: <p>I want to pass an some data into my directive so that I can use to as a parameter for my service. I tried something which I am not sure of.  I have no idea. I need to know how could I pass data into the directive so that I could use it.  Here i want to pass the ID so i can use it in the factory 
  The <strong>JAVASCRIPT</strong> file :</p>
  
  <pre><code>  var classificationViewModule = angular.module('ald.classificationview',[]);
  
      classificationViewModule.factory('classificationAPI',function(){
          return {
              getClassification:function($http,artifactId){
                  //TODO add URL
                  var url = "Classification/getInfo?artifactId="+artifactId
                  return $http({
                      method: 'GET',
                      url: url
                  });
              }
          };
      });
  
  classificationViewModule.directive('classificationview', function () {
      return {
          restrict: 'EA',
          scope: {},
          replace: true,
          link: function ($scope, element, attributes) {     
              $scope.artifactId = attribute["artifactId"];
  
          },
          controller: function ($scope, $http, classificationAPI) {
  
              classificationAPI.getClassification($http).success(function(data,status){               
                  //TODO
                  $scope.artifactClassification = data;
              }).error(function(data,status){
                  if (404==status){
                      alert("no text");
                  } else {
                      alert("bad stuff!");
                  }
              });            
          },
          //TODO add template url
          templateUrl: "classificationviewer.html"
      };
  });
  </code></pre>
  
  <p>In the <strong>HTML</strong> file. When I call the directive it should pass this value which can be used in teh factory method to request data :</p>
  
  <pre><code>&lt;classificationview artifactId="6450"/&gt; 
  </code></pre>