title: Delete user authenticated Firebase angular 5
body: <p>I would like to delete users authenticated by yours KEY, knowing that I am a administrator, firts I created an authservice and after an userService to associate with registered user</p>
  
  <p><a href="https://i.stack.imgur.com/pvHeV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pvHeV.png" alt="enter image description here"></a></p>
  
  <p>Now in Database I have the associate user
  <a href="https://i.stack.imgur.com/8DHCg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8DHCg.png" alt="enter image description here"></a></p>
  
  <p>Now in my code I have
  Firts, I created method auth to create user in auth.service.ts</p>
  
  <pre><code>    createUser(user: any, path: string) {
      return this.afu.auth.createUserWithEmailAndPassword(user.email, user.password)
                                  .then(() =&gt; {
                                    return this.service.save(user, path);
                                  })
                                  .catch((e) =&gt; console.log(e));
    }
  </code></pre>
  
  <p>this method create user authenticated and create in Database a user, calling the method save</p>
  
  <pre><code>    save(user: any, path: string) {
      const createdAt = new Date();
      return new Promise((resolve, reject) =&gt; {
        this.db.list(this.PATH + path)
              // .push(user)
                // console.log(createdAt)
              .push({ name: user.name, email: user.email, role: user.role_id, status: user.status, created_at: createdAt  })
              .then(() =&gt; resolve())
      })
    }
  </code></pre>
  
  <p>So, I have to delete this two registers by KEY in my method</p>
  
  <pre><code>    remove(key: string, path: string) {
      return this.db.list(this.PATH + path).remove(key);
    }
  </code></pre>
  
  <p>Remebering, I'm administrator</p>